{{{ public static class Map extends MapReduceBase implements Mapper { public void map(LongWritable key, Text value, OutputCollector output, Reporter reporter) throws IOException { while (tokenizer.hasMoreTokens()) { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); output.collect(word, one); }}} {{{ public static class Reduce extends MapReduceBase implements Reducer { public void reduce(Text key, Iterator values,OutputCollector output, Reporter reporter) throws IOException { int sum = 0; while (values.hasNext()) { sum += values.next().get(); } output.collect(key, new IntWritable(sum)); }}}