public abstract class ReduceFunction extends AbstractArrayModelFunction implements GenericReducer<Value[],Value[]>
| Constructor and Description |
|---|
ReduceFunction() |
| Modifier and Type | Method and Description |
|---|---|
void |
combine(Iterator<Value[]> records,
Collector<Value[]> out)
No default implementation provided.
|
Method |
getUDFMethod() |
abstract void |
reduce(Iterator<Value[]> records,
Collector<Value[]> out)
The central function to be implemented for a reducer.
|
getDataTypesclose, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getRuntimeContext, open, setRuntimeContextpublic abstract void reduce(Iterator<Value[]> records, Collector<Value[]> out) throws Exception
reduce in interface GenericReducer<Value[],Value[]>records - All records that belong to the given input key.out - The collector to hand results to.Exception - Implementations may forward exceptions, which are caught by the runtime. When the
runtime catches an exception, it aborts the reduce task and lets the fail-over logic
decide whether to retry the reduce execution.public void combine(Iterator<Value[]> records, Collector<Value[]> out) throws Exception
The use of the combiner is typically a pre-reduction of the data. It works similar as the reducer, only that is
is not guaranteed to see all values with the same key in one call to the combine function. Since it is called
prior to the reduce() method, input and output types of the combine method are the input types of
the reduce() method.
combine in interface GenericReducer<Value[],Value[]>records - The records to be combined. Unlike in the reduce method, these are not necessarily all records
belonging to the given key.out - The collector to write the result to.Exception - Implementations may forward exceptions, which are caught by the runtime. When the
runtime catches an exception, it aborts the combine task and lets the fail-over logic
decide whether to retry the combiner execution.eu.stratosphere.api.java.record.operators.ReduceOperator.Combinablepublic Method getUDFMethod()
getUDFMethod in class AbstractArrayModelFunctionCopyright © 2013–2014. All rights reserved.