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

    @PublicEvolving
    public class AggregatingStateDescriptor<IN,​ACC,​OUT>
    extends StateDescriptor<AggregatingState<IN,​OUT>,​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​(String name,
                                          AggregateFunction<IN,​ACC,​OUT> aggFunction,
                                          Class<ACC> stateType)
        Creates a new state descriptor 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.
      • AggregatingStateDescriptor

        public AggregatingStateDescriptor​(String name,
                                          AggregateFunction<IN,​ACC,​OUT> aggFunction,
                                          TypeInformation<ACC> stateType)
        Creates a new ReducingStateDescriptor with the given name and default value.
        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.
      • AggregatingStateDescriptor

        public AggregatingStateDescriptor​(String name,
                                          AggregateFunction<IN,​ACC,​OUT> aggFunction,
                                          TypeSerializer<ACC> typeSerializer)
        Creates a new ValueStateDescriptor with the given name and default value.
        Parameters:
        name - The (unique) name for the state.
        aggFunction - The AggregateFunction used to aggregate the state.
        typeSerializer - The serializer for the accumulator. The accumulator is stored in the state.