Interface GroupCombineFunction<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
    All Known Implementing Classes:
    RichGroupCombineFunction
    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 GroupCombineFunction<IN,​OUT>
    extends Function, Serializable
    Generic interface used for combine functions ("combiners"). Combiners act as auxiliaries to a 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 supports to return more than one element per group. It is frequently less efficient to use than the CombineFunction.

    • Method Detail

      • combine

        void combine​(Iterable<IN> values,
                     Collector<OUT> out)
              throws Exception
        The combine method, called (potentially multiple timed) with subgroups of elements.
        Parameters:
        values - The elements to be combined.
        out - The collector to use to return values from the function.
        Throws:
        Exception - The function may throw Exceptions, which will cause the program to cancel, and may trigger the recovery logic.