Class AggregatingStateDescriptor<IN,​ACC,​OUT>

  • Type Parameters:
    IN - The type of the values that are added to the state.
    ACC - The type of the accumulator (intermediate aggregation state).
    OUT - The type of the values that are returned from the state.
    All Implemented Interfaces:
    Serializable

    @Experimental
    public class AggregatingStateDescriptor<IN,​ACC,​OUT>
    extends StateDescriptor<ACC>
    A StateDescriptor for AggregatingState.

    The type internally stored in the state is the type of the Accumulator of the AggregateFunction.

    See Also:
    Serialized Form
    • Constructor Detail

      • AggregatingStateDescriptor

        public AggregatingStateDescriptor​(@Nonnull
                                          String stateId,
                                          @Nonnull
                                          org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT> aggregateFunction,
                                          @Nonnull
                                          TypeInformation<ACC> typeInfo)
        Create a new AggregatingStateDescriptor with the given name, function, and type.
        Parameters:
        stateId - The (unique) name for the state.
        aggregateFunction - The AggregateFunction used to aggregate the state.
        typeInfo - The type of the accumulator. The accumulator is stored in the state.
      • AggregatingStateDescriptor

        public AggregatingStateDescriptor​(@Nonnull
                                          String stateId,
                                          @Nonnull
                                          org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT> aggregateFunction,
                                          @Nonnull
                                          TypeSerializer<ACC> serializer)
        Create a new AggregatingStateDescriptor with the given stateId and the given type serializer.
        Parameters:
        stateId - The (unique) stateId for the state.
        serializer - The type serializer for accumulator.
      • AggregatingStateDescriptor

        public AggregatingStateDescriptor​(String name,
                                          org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT> aggFunction,
                                          Class<ACC> stateType)
        Creates a new AggregatingStateDescriptor with the given name, function, and type.

        If this constructor fails (because it is not possible to describe the type via a class), consider using the AggregatingStateDescriptor(String, AggregateFunction, TypeInformation) constructor.

        Parameters:
        name - The (unique) name for the state.
        aggFunction - The AggregateFunction used to aggregate the state.
        stateType - The type of the accumulator. The accumulator is stored in the state.
    • Method Detail

      • getAggregateFunction

        public org.apache.flink.api.common.functions.AggregateFunction<IN,​ACC,​OUT> getAggregateFunction()
        Returns the Aggregate function for this state.