Commit ac0a6dbb authored by dangq's avatar dangq

Stripes

parents 348bca33 7a98e761
......@@ -112,6 +112,7 @@ class StripesMapper extends
}
}
<<<<<<< HEAD:src/main/java/fr/eurecom/dsg/mapreduce/Stripes.java
class StripesReducer extends Reducer<Text, // input key type
StringToIntMapWritable, // input value type
Text, // output key type
......@@ -120,7 +121,23 @@ class StripesReducer extends Reducer<Text, // input key type
public void reduce(Text key, // input key type
Iterable<StringToIntMapWritable> values, // input value type
Context context) throws IOException, InterruptedException {
=======
class StripesReducer
extends Reducer<TextPair, // TODO: change Object to input key type
IntWritable, // TODO: change Object to input value type
TextPair, // TODO: change Object to output key type
IntWritable> { // TODO: change Object to output value type
@Override
public void reduce(TextPair key, // TODO: change Object to input key type
Iterable<IntWritable> values, // TODO: change Object to input value type
Context context) throws IOException, InterruptedException {
int accumulator = 0;
for (IntWritable value : values) {
accumulator += value.get();
}
>>>>>>> 7a98e76146298bed2deefdd460ad6b59720b3897:src/main/java/fr/eurecom/dsg/mapreduce/Stripes.java
<<<<<<< HEAD:src/main/java/fr/eurecom/dsg/mapreduce/Stripes.java
StringToIntMapWritable hf = new StringToIntMapWritable();
for (StringToIntMapWritable value : values) {
hf.sum(value);
......@@ -131,4 +148,9 @@ class StripesReducer extends Reducer<Text, // input key type
}
}
=======
context.write(key, new IntWritable(accumulator));
// TODO: implement the reduce method
}
>>>>>>> 7a98e76146298bed2deefdd460ad6b59720b3897:src/main/java/fr/eurecom/dsg/mapreduce/Stripes.java
}
\ No newline at end of file
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