code: @Override
      public int run(String[] args) throws Exception {
          Configuration conf = new Configuration();
          String[] otherArgs = new GenericOptionsParser(conf, args)
                  .getRemainingArgs();
          if (otherArgs.length != 2) {
              System.err.println("Usage: wordcount <in> <out>");
              return 2;
          }
  
          conf.set("nl.basjes.parse.apachehttpdlogline.format", logFormat);
  
          // A ',' separated list of fields
          conf.set("nl.basjes.parse.apachehttpdlogline.fields",
                  "STRING:request.status.last");
  
          Job job = Job.getInstance(conf, "word count");
          job.setJarByClass(Wordcount.class);
          FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
  
          job.setInputFormatClass(ApacheHttpdLogfileInputFormat.class);
          job.setMapperClass(TokenizerMapper.class);
          job.setCombinerClass(LongSumReducer.class);
          job.setReducerClass(LongSumReducer.class);
  
          // configuration should contain reference to your namenode
          FileSystem fs = FileSystem.get(conf);
          // true stands for recursively deleting the folder you gave
          Path outputPath = new Path(otherArgs[1]);
          fs.delete(outputPath, true);
          FileOutputFormat.setOutputPath(job, outputPath);
  
          job.setOutputKeyClass(Text.class);
          job.setOutputValueClass(LongWritable.class);
  
          if (job.waitForCompletion(true)) {
              return 0;
          }
          return 1;
      }
docs: ----------------------------------------------------------------------