@@ -0,0 +1,1854 @@
+package mapper;%0A%0Aimport java.io.IOException;%0Aimport java.util.*;%0A%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.conf.*;%0Aimport org.apache.hadoop.io.*;%0Aimport org.apache.hadoop.mapred.*;%0Aimport org.apache.hadoop.util.*;%0A%0Apublic class WordCount %7B%0A%0A  public static class Map extends MapReduceBase implements Mapper%3CLongWritable, Text, Text, IntWritable%3E %7B%0A    private final static IntWritable one = new IntWritable(1);%0A    private Text word = new Text();%0A%0A    public void map(LongWritable key, Text value, OutputCollector%3CText, IntWritable%3E output, Reporter reporter) throws IOException %7B%0A      String line = value.toString();%0A      StringTokenizer tokenizer = new StringTokenizer(line);%0A      while (tokenizer.hasMoreTokens()) %7B%0A        word.set(tokenizer.nextToken());%0A        output.collect(word, one);%0A      %7D%0A    %7D%0A  %7D%0A%0A  public static class Reduce extends MapReduceBase implements Reducer%3CText, IntWritable, Text, IntWritable%3E %7B%0A    public void reduce(Text key, Iterator%3CIntWritable%3E values, OutputCollector%3CText, IntWritable%3E output, Reporter reporter) throws IOException %7B%0A      int sum = 0;%0A      while (values.hasNext()) %7B%0A        sum += values.next().get();%0A      %7D%0A      output.collect(key, new IntWritable(sum));%0A    %7D%0A  %7D%0A%0A  public static void main(String%5B%5D args) throws Exception %7B%0A    JobConf conf = new JobConf(WordCount.class);%0A    conf.setJobName(%22wordcount%22);%0A%0A    conf.setOutputKeyClass(Text.class);%0A    conf.setOutputValueClass(IntWritable.class);%0A%0A    conf.setMapperClass(Map.class);%0A    conf.setCombinerClass(Reduce.class);%0A    conf.setReducerClass(Reduce.class);%0A%0A    conf.setInputFormat(TextInputFormat.class);%0A    conf.setOutputFormat(TextOutputFormat.class);%0A%0A    FileInputFormat.setInputPaths(conf, new Path(args%5B0%5D));%0A    FileOutputFormat.setOutputPath(conf, new Path(args%5B1%5D));%0A%0A    JobClient.runJob(conf);%0A  %7D%0A%7D%0A

package mapper;