Class TtlAggregateFunction<IN,ACC,OUT>

java.lang.Object
org.apache.flink.runtime.state.ttl.AbstractTtlDecorator<org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT>>
org.apache.flink.runtime.state.v2.ttl.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:
  • Constructor Details

    • 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 Details

    • 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>
    • merge

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