Interface CombineFunction<IN,OUT>
-
- Type Parameters:
IN
- The data type processed by the combine function.OUT
- The data type emitted by the combine function.
- All Superinterfaces:
Function
,Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Public @FunctionalInterface public interface CombineFunction<IN,OUT> extends Function, Serializable
Generic interface used for combine functions ("combiners"). Combiners act as auxiliaries to aGroupReduceFunction
and "pre-reduce" the data. The combine functions typically do not see the entire group of elements, but only a sub-group.Combine functions are frequently helpful in increasing the program efficiency, because they allow the system to reduce the data volume earlier, before the entire groups have been collected.
This special variant of the combine function reduces the group of elements into a single element. A variant that can return multiple values per group is defined in
GroupCombineFunction
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OUT
combine(Iterable<IN> values)
The combine method, called (potentially multiple timed) with subgroups of elements.
-
-
-
Method Detail
-
combine
OUT combine(Iterable<IN> values) throws Exception
The combine method, called (potentially multiple timed) with subgroups of elements.- Parameters:
values
- The elements to be combined.- Returns:
- The single resulting value.
- Throws:
Exception
- The function may throw Exceptions, which will cause the program to cancel, and may trigger the recovery logic.
-
-