IN
- The data type processed by the combine function.OUT
- The data type emitted by the combine function.@Public @FunctionalInterface public interface CombineFunction<IN,OUT> extends Function, Serializable
GroupReduceFunction
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
.
Modifier and Type | Method and Description |
---|---|
OUT |
combine(Iterable<IN> values)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
OUT combine(Iterable<IN> values) throws Exception
values
- The elements to be combined.Exception
- The function may throw Exceptions, which will cause the program to cancel,
and may trigger the recovery logic.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.