Commit 7a98e761 authored by dangq's avatar dangq

Pairs and Stripes

parent 19b01b2c
...@@ -108,7 +108,12 @@ extends Reducer<TextPair, // TODO: change Object to input key type ...@@ -108,7 +108,12 @@ extends Reducer<TextPair, // TODO: change Object to input key type
public void reduce(TextPair key, // TODO: change Object to input key type public void reduce(TextPair key, // TODO: change Object to input key type
Iterable<IntWritable> values, // TODO: change Object to input value type Iterable<IntWritable> values, // TODO: change Object to input value type
Context context) throws IOException, InterruptedException { Context context) throws IOException, InterruptedException {
int accumulator = 0;
for (IntWritable value : values) {
accumulator += value.get();
}
context.write(key, new IntWritable(accumulator));
// TODO: implement the reduce method // TODO: implement the reduce method
} }
} }
\ No newline at end of file
Manifest-Version: 1.0 Manifest-Version: 1.0
Build-Jdk: 1.7.0_75 Build-Jdk: 1.7.0_75
Built-By: hrua Built-By: heocon
Created-By: IntelliJ IDEA Created-By: IntelliJ IDEA
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment