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();
FileSystem fs = FileSystem.get(conf);