Class RichAggregateFunction<IN,​ACC,​OUT>

  • Type Parameters:
    IN - The type of the values that are aggregated (input values)
    ACC - The type of the accumulator (intermediate aggregate state).
    OUT - The type of the aggregated result
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>, org.apache.flink.api.common.functions.Function, RichFunction

    @PublicEvolving
    public abstract class RichAggregateFunction<IN,​ACC,​OUT>
    extends AbstractRichFunction
    implements org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>
    Rich variant of the AggregateFunction. As a RichFunction, it gives access to the RuntimeContext and provides setup and teardown methods: RichFunction.open(OpenContext) and RichFunction.close().
    See Also:
    AggregateFunction, Serialized Form
    • Constructor Detail

      • RichAggregateFunction

        public RichAggregateFunction()
    • Method Detail

      • createAccumulator

        public abstract ACC createAccumulator()
        Specified by:
        createAccumulator in interface org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>
      • add

        public abstract ACC add​(IN value,
                                ACC accumulator)
        Specified by:
        add in interface org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>
      • getResult

        public abstract OUT getResult​(ACC accumulator)
        Specified by:
        getResult in interface org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>
      • merge

        public abstract ACC merge​(ACC a,
                                  ACC b)
        Specified by:
        merge in interface org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>