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

    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
                                          org.apache.flink.api.common.typeinfo.TypeInformation<ACC> typeInfo)
        Create a new state descriptor 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
                                          org.apache.flink.api.common.typeinfo.TypeInformation<ACC> typeInfo,
                                          org.apache.flink.api.common.serialization.SerializerConfig serializerConfig)
        Create a new state descriptor 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.
        serializerConfig - The serializer related config used to generate TypeSerializer.
    • Method Detail

      • getAggregateFunction

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