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.public class AggregatingStateDescriptor<IN,ACC,OUT> extends StateDescriptor<ACC>
StateDescriptor for AggregatingState.
The type internally stored in the state is the type of the Accumulator of the AggregateFunction.
StateDescriptor.Type| Constructor and Description |
|---|
AggregatingStateDescriptor(String stateId,
org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> aggregateFunction,
org.apache.flink.api.common.typeinfo.TypeInformation<ACC> typeInfo)
Create a new state descriptor with the given name, function, and type.
|
AggregatingStateDescriptor(String stateId,
org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> aggregateFunction,
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.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> |
getAggregateFunction()
Returns the Aggregate function for this state.
|
StateDescriptor.Type |
getType()
Return the specific
Type of described state. |
enableTimeToLive, equals, getSerializer, getStateId, getTtlConfig, hashCode, toStringpublic 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)
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.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)
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.public org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> getAggregateFunction()
public StateDescriptor.Type getType()
StateDescriptorType of described state.getType in class StateDescriptor<ACC>Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.