edu.purdue.cs.eblanton
Class CounterReduce

java.lang.Object
  extended by org.apache.hadoop.mapred.MapReduceBase
      extended by edu.purdue.cs.eblanton.CounterReduce
All Implemented Interfaces:
java.io.Closeable, org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable>

public class CounterReduce
extends org.apache.hadoop.mapred.MapReduceBase
implements org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable>

CounterReduce implements a reduction which accepts any WritableComparable object and a vector of IntWritable occurrence counts, and sums these counts.

See Also:
MapReduceBase, Reducer

Constructor Summary
CounterReduce()
           
 
Method Summary
 void reduce(org.apache.hadoop.io.WritableComparable key, java.util.Iterator<org.apache.hadoop.io.IntWritable> values, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable> output, org.apache.hadoop.mapred.Reporter reporter)
          Implements the CounterReduce reduction operation.
 
Methods inherited from class org.apache.hadoop.mapred.MapReduceBase
close, configure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable
configure
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

CounterReduce

public CounterReduce()
Method Detail

reduce

public void reduce(org.apache.hadoop.io.WritableComparable key,
                   java.util.Iterator<org.apache.hadoop.io.IntWritable> values,
                   org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable> output,
                   org.apache.hadoop.mapred.Reporter reporter)
            throws java.io.IOException
Implements the CounterReduce reduction operation.

Specified by:
reduce in interface org.apache.hadoop.mapred.Reducer<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.IntWritable>
Parameters:
key - the WritableComparable object being counted
values - iterator over counts provided by the Map operation
output - the output collector for the resulting sum
reporter - ignored
Throws:
java.io.IOException