Method
reduce
(final Text key, final Iterable<DoubleWritable> values, final Context context)
Source from the content-addressed store, hash-verified
| 264 | |
| 265 | public static final class SumReducer extends Reducer<Text,DoubleWritable,Text,DoubleWritable> { // TODO: check if there is a standard summer we could use here |
| 266 | @Override |
| 267 | public void reduce(final Text key, final Iterable<DoubleWritable> values, final Context context) throws IOException, InterruptedException { |
| 268 | double total = 0.0; |
| 269 | for(final DoubleWritable vi: values) { |
| 270 | total += vi.get(); |
| 271 | } |
| 272 | if(total!=0.0) { |
| 273 | context.write(new Text(key.toString()),new DoubleWritable(total)); |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | @Override |
Callers
nothing calls this directly
Tested by
no test coverage detected