Class AggregatingStateDescriptor<IN,ACC,OUT>
- java.lang.Object
-
- org.apache.flink.api.common.state.StateDescriptor<AggregatingState<IN,OUT>,ACC>
-
- org.apache.flink.api.common.state.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 forAggregatingState.The type internally stored in the state is the type of the
Accumulatorof theAggregateFunction.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.api.common.state.StateDescriptor
StateDescriptor.Type
-
-
Field Summary
-
Fields inherited from class org.apache.flink.api.common.state.StateDescriptor
defaultValue, name
-
-
Constructor Summary
Constructors Constructor Description AggregatingStateDescriptor(String name, AggregateFunction<IN,ACC,OUT> aggFunction, Class<ACC> stateType)Creates a new state descriptor with the given name, function, and type.AggregatingStateDescriptor(String name, AggregateFunction<IN,ACC,OUT> aggFunction, TypeInformation<ACC> stateType)Creates a newReducingStateDescriptorwith the given name and default value.AggregatingStateDescriptor(String name, AggregateFunction<IN,ACC,OUT> aggFunction, TypeSerializer<ACC> typeSerializer)Creates a newValueStateDescriptorwith the given name and default value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregateFunction<IN,ACC,OUT>getAggregateFunction()Returns the aggregate function to be used for the state.StateDescriptor.TypegetType()-
Methods inherited from class org.apache.flink.api.common.state.StateDescriptor
enableTimeToLive, equals, getDefaultValue, getName, getQueryableStateName, getSerializer, getTtlConfig, hashCode, initializeSerializerUnlessSet, isQueryable, isSerializerInitialized, setQueryable, toString
-
-
-
-
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- TheAggregateFunctionused 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 newReducingStateDescriptorwith the given name and default value.- Parameters:
name- The (unique) name for the state.aggFunction- TheAggregateFunctionused 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 newValueStateDescriptorwith the given name and default value.- Parameters:
name- The (unique) name for the state.aggFunction- TheAggregateFunctionused to aggregate the state.typeSerializer- The serializer for the accumulator. The accumulator is stored in the state.
-
-
Method Detail
-
getAggregateFunction
public AggregateFunction<IN,ACC,OUT> getAggregateFunction()
Returns the aggregate function to be used for the state.
-
getType
public StateDescriptor.Type getType()
- Specified by:
getTypein classStateDescriptor<AggregatingState<IN,OUT>,ACC>
-
-