Class ReducingStateDescriptor<T>
- java.lang.Object
-
- org.apache.flink.api.common.state.v2.StateDescriptor<T>
-
- org.apache.flink.api.common.state.v2.ReducingStateDescriptor<T>
-
- Type Parameters:
T- The type of the values that can be added to the state.
- All Implemented Interfaces:
Serializable
@Experimental public class ReducingStateDescriptor<T> extends StateDescriptor<T>
StateDescriptorforReducingState.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.api.common.state.v2.StateDescriptor
StateDescriptor.Type
-
-
Constructor Summary
Constructors Constructor Description ReducingStateDescriptor(String name, org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, Class<T> typeClass)Creates a newReducingStateDescriptorwith the given name, type, and default value.ReducingStateDescriptor(String name, org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, TypeInformation<T> typeInfo)Creates a newReducingStateDescriptorwith the given name and default value.ReducingStateDescriptor(String stateId, org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, TypeSerializer<T> serializer)Create a newReducingStateDescriptorwith the given stateId and the given type serializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.common.functions.ReduceFunction<T>getReduceFunction()Returns the reduce function to be used for the reducing state.StateDescriptor.TypegetType()Return the specificTypeof described state.-
Methods inherited from class org.apache.flink.api.common.state.v2.StateDescriptor
enableTimeToLive, equals, getSerializer, getStateId, getTtlConfig, getTypeInformation, hashCode, initializeSerializerUnlessSet, initializeSerializerUnlessSet, isSerializerInitialized, toString
-
-
-
-
Constructor Detail
-
ReducingStateDescriptor
public ReducingStateDescriptor(@Nonnull String name, @Nonnull org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, @Nonnull TypeInformation<T> typeInfo)Creates a newReducingStateDescriptorwith the given name and default value.- Parameters:
name- The (unique) name for the state.reduceFunction- TheReduceFunctionused to aggregate the state.typeInfo- The type of the values in the state.
-
ReducingStateDescriptor
public ReducingStateDescriptor(@Nonnull String stateId, @Nonnull org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, @Nonnull TypeSerializer<T> serializer)Create a newReducingStateDescriptorwith the given stateId and the given type serializer.- Parameters:
stateId- The (unique) stateId for the state.serializer- The type serializer for the values in the state.
-
ReducingStateDescriptor
public ReducingStateDescriptor(String name, org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction, Class<T> typeClass)
Creates a newReducingStateDescriptorwith the given name, type, and default value.If this constructor fails (because it is not possible to describe the type via a class), consider using the
ReducingStateDescriptor(String, ReduceFunction, TypeInformation)constructor.- Parameters:
name- The (unique) name for the state.reduceFunction- TheReduceFunctionused to aggregate the state.typeClass- The type of the values in the state.
-
-
Method Detail
-
getReduceFunction
public org.apache.flink.api.common.functions.ReduceFunction<T> getReduceFunction()
Returns the reduce function to be used for the reducing state.
-
getType
public StateDescriptor.Type getType()
Description copied from class:StateDescriptorReturn the specificTypeof described state.- Specified by:
getTypein classStateDescriptor<T>
-
-