Package 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
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Subclasses can override this as desired.void
Subclasses can override this as desired.void
Called with all map output values with a given key.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Constructor Details
-
AvroReducer
public AvroReducer()
-
-
Method Details
-
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, collectingPair
instances.- Throws:
IOException
-
close
Subclasses can override this as desired.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
configure
Subclasses can override this as desired.- Specified by:
configure
in interfaceJobConfigurable
-