@@ -0,0 +1,1692 @@
+package com.cloudwick.hadoop.statuscode;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.conf.Configured;%0Aimport org.apache.hadoop.io.IntWritable;%0Aimport org.apache.hadoop.io.Text;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.mapreduce.Job;%0Aimport org.apache.hadoop.util.Tool;%0Aimport org.apache.hadoop.util.ToolRunner;%0Aimport org.apache.hadoop.mapreduce.lib.input.FileInputFormat;%0Aimport org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;%0A%0A/*%0A * Created by Darshan S Mahendrakar%0A * Date: 06/05/2015%0A * Email: darshan.sm@cloudwick.com%0A */%0Apublic class StatusCountDriver extends Configured implements Tool %7B%0A%0A%09public int run(String%5B%5D args) throws IOException, ClassNotFoundException,%0A%09%09%09InterruptedException %7B%0A%09%09if (args.length != 2) %7B%0A%09%09%09System.err.println(%22Usage:StatusCountDriver %3Cin%3E %3Cout%3E%22);%0A%09%09%09System.exit(2);%0A%09%09%7D%0A%09%09Configuration conf = getConf();%0A%09%09Job job = Job.getInstance(conf);%0A%09%09job.setJobName(%22status count%22);%0A%09%09job.setJarByClass(StatusCountDriver.class);%0A%09%09job.setMapperClass(StatusCountMapper.class);%0A%09%09job.setCombinerClass(StatusCountReducer.class);%0A%09%09job.setReducerClass(StatusCountReducer.class);%0A%0A%09%09job.setMapOutputKeyClass(Text.class);%0A%09%09job.setMapOutputValueClass(IntWritable.class);%0A%0A%09%09job.setOutputKeyClass(Text.class);%0A%09%09job.setOutputValueClass(IntWritable.class);%0A%0A%09%09FileInputFormat.addInputPath(job, new Path(args%5B0%5D));%0A%09%09FileOutputFormat.setOutputPath(job, new Path(args%5B1%5D));%0A%0A%09%09int ret = job.waitForCompletion(true) ? 0 : 1;%0A%09%09return ret;%0A%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09int res = ToolRunner.run(new Configuration(), new StatusCountDriver(),%0A%09%09%09%09args);%0A%09%7D%0A%0A%7D%0A

Create StatusCountDriver.java