org.apache.hadoop.mapreduce.lib.aggregate

## Class ValueAggregatorReducer<K1 extends org.apache.hadoop.io.WritableComparable<?>,V1 extends org.apache.hadoop.io.Writable>

- java.lang.Object
- - org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
  - - org.apache.hadoop.mapreduce.lib.aggregate.ValueAggregatorReducer<K1,V1>

-     @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class ValueAggregatorReducer<K1 extends org.apache.hadoop.io.WritableComparable<?>,V1 extends org.apache.hadoop.io.Writable>
      extends Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>

  This class implements the generic reducer of Aggregate.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer

      `Reducer.Context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValueAggregatorReducer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `reduce(org.apache.hadoop.io.Text key, Iterable<org.apache.hadoop.io.Text> values, Reducer.Context context)` This method is called once for each key.
    `void` | `setup(Reducer.Context context)` Called once at the start of the task.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.Reducer

      `cleanup, run`

    - ### 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

    - #### setup

          public void setup(Reducer.Context context)
                     throws IOException,
                            InterruptedException

      Description copied from class: `Reducer`
      Called once at the start of the task.
      Overrides:
        `setup` in class `Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>`
      Throws:
        `IOException`
        `InterruptedException`

    - #### reduce

          public void reduce(org.apache.hadoop.io.Text key,
                             Iterable<org.apache.hadoop.io.Text> values,
                             Reducer.Context context)
                      throws IOException,
                             InterruptedException

      Description copied from class: `Reducer`
      This 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:
        `reduce` in class `Reducer<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text,org.apache.hadoop.io.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 aggregated
        `context` -
      Throws:
        `IOException`
        `InterruptedException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.