Mostly Hadoop MapReduce Jobs operates with two arguments.
Input directory and Output directory.
Each time when we run our MapReduce job we need to give non-existing folder as our output path. So while we are doing a Trail and Error method in our MR jobs. It is good if it automatically deletes the output folder if exists.
Here is the code for that:
/*Provides access to configuration parameters*/
Configuration conf = new Configuration();
/*Creating Filesystem object with the configuration*/
FileSystem fs = FileSystem.get(conf);
/*Check if output path (args[1])exist or not*/
if(fs.exists(new Path(args[1]))){
/*If exist delete the output path*/
fs.delete(new Path(args[1]),true);
}
Basically i know nothing about Hadoop.But feels great seeing an attempt to share things that u learn. Really nice. Will make use of this information someday for sure. :-)
ReplyDeleteFortunately, Apache Hadoop is a tailor-made solution that delivers on both counts, by turning big data insights into actionable business enhancements for long-term success. To know more, visit Hadoop Training Bangalore
ReplyDeleteActually I'm using scala . I have deleted the existing output folder and tried it. It is not throwing any exception . But my output file is not created in run time. I'm not able to access my output values what I was stored. What I want to do for this ?
ReplyDeleteI am really admired for the great info is visible in this blog that to lot of benefits for visiting the nice info in this website.
ReplyDeleteThanks a lot for using the nice info is visible in this blog.latestITjobs | Hadoop Training in Chennai |
Nice Article ..Thanks for providing information that was worth reading & sharing
ReplyDeleteielts coaching in Hyderabad
Machine Learning Course in Hyderabad
Power bi training Hyderabad
Python training in Hyderabad
Thanks and sharing AWS info also.
ReplyDeleteaws training in hyderabad
This comment has been removed by the author.
ReplyDeleteVery informative. Thanks for sharing.
ReplyDeleteBest Bike Taxi Service in Hyderabad
Best software Service in Hyderabad
https://www.digitalbrolly.com/digital-marketing-course-in-hyderabad/
ReplyDeleteDIGITAL MARKETING COURSE IN HYDERABAD OUTCOMES
Our Digital Marketing course in Hyderabad is a huge benefit to students, job seekers, freelancers and business owners. If you are a student or a job seeker this course will help you get a good job in Digital Marketing. If you are a freelancer or a business owner, this course would give you numerous tricks to generate more leads for your business. Honestly speaking, Digital Marketing is easy to learn. Executing and getting results from Digital Marketing isn’t difficult too. I would say it is a simple 3 step process.
Step 01
Nice Blog Keep Posting.
ReplyDeleteDevOps training institute in hyderabad with placement
nice article
ReplyDeletethanks for sheering us
Azure admin training in hyderabad
SQL Training in Hyderabad
ReplyDeleteI really appreciate. It helped me understand much better.
Your explanations were clear and easy to follow. Thanks again for sharing this valuable information!
This post offers a lot of valuable information in an easy-to-read manner
ReplyDelete