org.apache.avro.mapred

## Class AvroReducer<K,V,OUT>

- java.lang.Object
- - org.apache.hadoop.conf.Configured
  - - org.apache.avro.mapred.AvroReducer<K,V,OUT>

- All Implemented Interfaces:
    Closeable, AutoCloseable, Configurable, JobConfigurable

      public class AvroReducer<K,V,OUT>
      extends Configured
      implements JobConfigurable, Closeable

  A reducer for Avro data.

  Applications should subclass this class and pass their subclass to `AvroJob.setReducerClass(JobConf, Class)` and perhaps `AvroJob.setCombinerClass(JobConf, Class)`. Subclasses override `reduce(Object, Iterable, AvroCollector, Reporter)`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AvroReducer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Subclasses can override this as desired.
    `void` | `configure(JobConf jobConf)` Subclasses can override this as desired.
    `void` | `reduce(K key, Iterable<V> values, AvroCollector<OUT> collector, Reporter reporter)` Called with all map output values with a given key.

    - ### Methods inherited from class org.apache.hadoop.conf.Configured

      `getConf, setConf`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AvroReducer

          public AvroReducer()

  - ### Method Detail

    - #### reduce

          public void reduce(K key,
                             Iterable<V> values,
                             AvroCollector<OUT> collector,
                             Reporter reporter)
                      throws IOException

      Called with all map output values with a given key. By default, pairs key with each value, collecting `Pair` instances.
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Subclasses can override this as desired.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

    - #### configure

          public void configure(JobConf jobConf)

      Subclasses can override this as desired.
      Specified by:
        `configure` in interface `JobConfigurable`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.