org.apache.hadoop.mapred.lib.aggregate
Class ValueAggregatorReducer

java.lang.Object
  extended by org.apache.hadoop.mapred.lib.aggregate.ValueAggregatorJobBase
      extended by org.apache.hadoop.mapred.lib.aggregate.ValueAggregatorReducer
All Implemented Interfaces:
Closeable, JobConfigurable, Mapper, Reducer

public class ValueAggregatorReducer
extends ValueAggregatorJobBase

This class implements the generic reducer of Abacus.


Field Summary
 
Fields inherited from class org.apache.hadoop.mapred.lib.aggregate.ValueAggregatorJobBase
aggregatorDescriptorList
 
Constructor Summary
ValueAggregatorReducer()
           
 
Method Summary
 void map(WritableComparable arg0, Writable arg1, OutputCollector arg2, Reporter arg3)
          Do nothing.
 void reduce(WritableComparable key, Iterator values, OutputCollector output, Reporter reporter)
          Combines values for a given key.
 
Methods inherited from class org.apache.hadoop.mapred.lib.aggregate.ValueAggregatorJobBase
close, configure, logSpec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueAggregatorReducer

public ValueAggregatorReducer()
Method Detail

reduce

public void reduce(WritableComparable key,
                   Iterator values,
                   OutputCollector output,
                   Reporter reporter)
            throws IOException
Description copied from interface: Reducer
Combines values for a given key. Output values must be of the same type as input values. Input keys must not be altered. Typically all values are combined into zero or one value. Output pairs are collected with calls to OutputCollector.collect(WritableComparable,Writable).

Parameters:
key - the key is expected to be a Text object, whose prefix indicates the type of aggregation to aggregate the values. In effect, data driven computing is achieved. It is assumed that each aggregator's getReport method emits appropriate output for the aggregator. This may be further customiized.
values - the values to combine
output - to collect combined values
Throws:
IOException

map

public void map(WritableComparable arg0,
                Writable arg1,
                OutputCollector arg2,
                Reporter arg3)
         throws IOException
Do nothing. Should not be called

Parameters:
arg0 - the key
arg1 - the values
arg2 - collects mapped keys and values
Throws:
IOException


Copyright © 2006 The Apache Software Foundation