Class TtlAggregateFunction<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,​TtlValue<ACC>,​OUT>, org.apache.flink.api.common.functions.Function

    public class TtlAggregateFunction<IN,​ACC,​OUT>
    extends AbstractTtlDecorator<org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT>>
    implements org.apache.flink.api.common.functions.AggregateFunction<IN,​TtlValue<ACC>,​OUT>
    This class wraps aggregating function with TTL logic.
    See Also:
    Serialized Form
    • Constructor Detail

      • TtlAggregateFunction

        public TtlAggregateFunction​(org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT> aggFunction,
                                    org.apache.flink.api.common.state.StateTtlConfig config,
                                    TtlTimeProvider timeProvider)
    • Method Detail

      • createAccumulator

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

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

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