Class ValueAggregatorReducer<K1 extends WritableComparable<?>,V1 extends Writable>
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<Text,Text,Text,Text>
org.apache.hadoop.mapreduce.lib.aggregate.ValueAggregatorReducer<K1,V1>
@Public
@Stable
public class ValueAggregatorReducer<K1 extends WritableComparable<?>,V1 extends Writable>
extends Reducer<Text,Text,Text,Text>
This class implements the generic reducer of Aggregate.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ValueAggregatorReducer
public ValueAggregatorReducer()
-
-
Method Details
-
setup
public void setup(Reducer<Text, Text, throws IOException, InterruptedExceptionText, Text>.org.apache.hadoop.mapreduce.Reducer.Context context) Description copied from class:ReducerCalled once at the start of the task.- Overrides:
setupin classReducer<Text,Text, Text, Text> - Throws:
IOExceptionInterruptedException
-
reduce
public void reduce(Text key, Iterable<Text> values, Reducer<Text, Text, throws IOException, InterruptedExceptionText, Text>.org.apache.hadoop.mapreduce.Reducer.Context context) Description copied from class:ReducerThis method is called once for each key. Most applications will define their reduce class by overriding this method. The default implementation is an identity function.- Overrides:
reducein classReducer<Text,Text, Text, Text> - 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 customized.values- the values to be aggregatedcontext-- Throws:
IOExceptionInterruptedException
-