Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public static class Reduce extends MapReduceBase implements Reducer<Text, IntWritable, Text, IntWritable> {
  2. public void reduce(Text key, Iterator<IntWritable> values, OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {
  3. int sum = 0;
  4. while (values.hasNext()) {
  5. sum += values.next().get();
  6. }
  7. output.collect(key, new IntWritable(sum));
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement