aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsabhi <abhi.is2006@gmail.com>2016-12-15 02:41:45 -0500
committerGitHub <noreply@github.com>2016-12-15 02:41:45 -0500
commitb29075ebe8dd2aba5c638ec0692cc7b3890dcc7b (patch)
treef82ced12b2e3548afd605e5f8231b11f573bf4bc
parentde5eb93117c9729df46d0085ef89662f67a62d9c (diff)
Update big-data.md
-rw-r--r--chapter/8/big-data.md13
1 files changed, 5 insertions, 8 deletions
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<LongWritable, Text, Text, IntWritable>
+ public static class Map extends Mapper<LongWritable, Text, Text, IntWritable>
{
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<Text, IntWritable, Text, IntWritable>
+ public static class Reduce extends Reducer<Text, IntWritable, Text, IntWritable>
{
public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException
{