Skip to content

Instantly share code, notes, and snippets.

@nstasino
nstasino / Reducer.java
Created February 7, 2012 16:25
Hadoop reuse reducer value input (buffer style)
public void reduce(LongWritable key, Iterable<LongWritable> values,
Context context) throws IOException, InterruptedException {
List<LongWritable> buffer = new ArrayList<LongWritable>();
List<LongWritable> buffer2 = new ArrayList<LongWritable>();
for (LongWritable val : values) {
buffer.add(new LongWritable(val.get()));
buffer2.add(new LongWritable(val.get()));
}