@Internal public class CombineToGroupCombineWrapper<IN,OUT,F extends CombineFunction<IN,IN> & GroupReduceFunction<IN,OUT>> extends Object implements GroupCombineFunction<IN,IN>, GroupReduceFunction<IN,OUT>
CombineFunction
and GroupReduceFunction
interfaces and makes it look like a function that implements GroupCombineFunction
and GroupReduceFunction
to the runtime.Constructor and Description |
---|
CombineToGroupCombineWrapper(F wrappedFunction) |
Modifier and Type | Method and Description |
---|---|
void |
combine(Iterable<IN> values,
Collector<IN> out)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
void |
reduce(Iterable<IN> values,
Collector<OUT> out)
The reduce method.
|
public CombineToGroupCombineWrapper(F wrappedFunction)
public void combine(Iterable<IN> values, Collector<IN> out) throws Exception
GroupCombineFunction
combine
in interface GroupCombineFunction<IN,IN>
values
- The elements to be combined.out
- The collector to use to return values from the function.Exception
- The function may throw Exceptions, which will cause the program to cancel,
and may trigger the recovery logic.public void reduce(Iterable<IN> values, Collector<OUT> out) throws Exception
GroupReduceFunction
reduce
in interface GroupReduceFunction<IN,OUT>
values
- All records that belong to the given input key.out
- The collector to hand results to.Exception
- This method may throw exceptions. Throwing an exception will cause the
operation to fail and may trigger recovery.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.