@@ -0,0 +1,2089 @@
+import java.io.IOException;%0Aimport java.util.StringTokenizer;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.io.IntWritable;%0Aimport org.apache.hadoop.io.Text;%0Aimport org.apache.hadoop.mapreduce.Job;%0Aimport org.apache.hadoop.mapreduce.Mapper;%0Aimport org.apache.hadoop.mapreduce.Reducer;%0Aimport org.apache.hadoop.mapreduce.lib.input.FileInputFormat;%0Aimport org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;%0A%0Apublic class WordCount %7B%0A%0A  public static class TokenizerMapper%0A       extends Mapper%3CObject, Text, Text, IntWritable%3E%7B%0A%0A    private final static IntWritable one = new IntWritable(1);%0A    private Text word = new Text();%0A%0A    public void map(Object key, Text value, Context context%0A                    ) throws IOException, InterruptedException %7B%0A      StringTokenizer itr = new StringTokenizer(value.toString());%0A      while (itr.hasMoreTokens()) %7B%0A        word.set(itr.nextToken());%0A        context.write(word, one);%0A      %7D%0A    %7D%0A  %7D%0A%0A  public static class IntSumReducer%0A       extends Reducer%3CText,IntWritable,Text,IntWritable%3E %7B%0A    private IntWritable result = new IntWritable();%0A%0A    public void reduce(Text key, Iterable%3CIntWritable%3E values,%0A                       Context context%0A                       ) throws IOException, InterruptedException %7B%0A      int sum = 0;%0A      for (IntWritable val : values) %7B%0A        sum += val.get();%0A      %7D%0A      result.set(sum);%0A      context.write(key, result);%0A    %7D%0A  %7D%0A%0A  public static void main(String%5B%5D args) throws Exception %7B%0A    Configuration conf = new Configuration();%0A    Job job = Job.getInstance(conf, %22word count%22);%0A    job.setJarByClass(WordCount.class);%0A    job.setMapperClass(TokenizerMapper.class);%0A    job.setCombinerClass(IntSumReducer.class);%0A    job.setReducerClass(IntSumReducer.class);%0A    job.setOutputKeyClass(Text.class);%0A    job.setOutputValueClass(IntWritable.class);%0A    FileInputFormat.addInputPath(job, new Path(args%5B0%5D));%0A    FileOutputFormat.setOutputPath(job, new Path(args%5B1%5D));%0A    System.exit(job.waitForCompletion(true) ? 0 : 1);%0A  %7D%0A%7D%0A

add sample wordcount