for (Map.Entry<Text, List<VertexWritable>> entry : data.entrySet()) {
combiner.reduce(entry.getKey(), entry.getValue(), comContext);
}
// finally, set up the reduction writers
EigencutsAffinityCutsReducer reducer = new EigencutsAffinityCutsReducer();
DummyRecordWriter<IntWritable, VectorWritable> redWriter = new
DummyRecordWriter<IntWritable, VectorWritable>();
Reducer<Text, VertexWritable, IntWritable, VectorWritable>.Context
redContext = DummyRecordWriter.build(reducer, conf, redWriter,
Text.class, VertexWritable.class);
// perform the reduction
for (Text key : comWriter.getKeys()) {
reducer.reduce(key, comWriter.getValue(key), redContext);
}
// now, check that the affinity matrix is correctly formed
for (IntWritable row : redWriter.getKeys()) {
List<VectorWritable> results = redWriter.getValue(row);