Class ReducingStateDescriptor<T>
- java.lang.Object
-
- org.apache.flink.api.common.state.StateDescriptor<ReducingState<T>,T>
-
- org.apache.flink.api.common.state.ReducingStateDescriptor<T>
-
- Type Parameters:
T- The type of the values that can be added to the list state.
- All Implemented Interfaces:
Serializable
@PublicEvolving public class ReducingStateDescriptor<T> extends StateDescriptor<ReducingState<T>,T>
StateDescriptorforReducingState. This can be used to create partitioned reducing state usingRuntimeContext.getReducingState(ReducingStateDescriptor).- 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 ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, Class<T> typeClass)Creates a newReducingStateDescriptorwith the given name, type, and default value.ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, TypeInformation<T> typeInfo)Creates a newReducingStateDescriptorwith the given name and default value.ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, TypeSerializer<T> typeSerializer)Creates a newValueStateDescriptorwith the given name and default value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReduceFunction<T>getReduceFunction()Returns the reduce function to be used for the reducing 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
-
ReducingStateDescriptor
public ReducingStateDescriptor(String name, 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.
-
ReducingStateDescriptor
public ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, 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(String name, ReduceFunction<T> reduceFunction, TypeSerializer<T> typeSerializer)
Creates a newValueStateDescriptorwith the given name and default value.- Parameters:
name- The (unique) name for the state.reduceFunction- TheReduceFunctionused to aggregate the state.typeSerializer- The type serializer of the values in the state.
-
-
Method Detail
-
getReduceFunction
public ReduceFunction<T> getReduceFunction()
Returns the reduce function to be used for the reducing state.
-
getType
public StateDescriptor.Type getType()
- Specified by:
getTypein classStateDescriptor<ReducingState<T>,T>
-
-