Skip to content

Instantly share code, notes, and snippets.

@nstasino
Created February 7, 2012 16:25
Show Gist options
  • Save nstasino/1760541 to your computer and use it in GitHub Desktop.
Save nstasino/1760541 to your computer and use it in GitHub Desktop.
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()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment