From b29075ebe8dd2aba5c638ec0692cc7b3890dcc7b Mon Sep 17 00:00:00 2001 From: msabhi Date: Thu, 15 Dec 2016 02:41:45 -0500 Subject: Update big-data.md --- chapter/8/big-data.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'chapter') diff --git a/chapter/8/big-data.md b/chapter/8/big-data.md index 915325e..2df67a3 100644 --- a/chapter/8/big-data.md +++ b/chapter/8/big-data.md @@ -85,26 +85,23 @@ import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; public class WordCount { - public static class Map extends - Mapper + public static class Map extends Mapper { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); - public void map(LongWritable key, Text value, Context context) - throws IOException, InterruptedException + public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String line = value.toString(); StringTokenizer tokenizer = new StringTokenizer(line); while (tokenizer.hasMoreTokens()) { - word.set(tokenizer.nextToken()); - context.write(word, one); + word.set(tokenizer.nextToken()); + context.write(word, one); } } - public static class Reduce - extends Reducer + public static class Reduce extends Reducer { public void reduce(Text key, Iterable values, Context context) throws IOException, InterruptedException { -- cgit v1.2.3