Class ValueStateDescriptor<T>
- java.lang.Object
-
- org.apache.flink.api.common.state.v2.StateDescriptor<T>
-
- org.apache.flink.api.common.state.v2.ValueStateDescriptor<T>
-
- Type Parameters:
T- The type of the values that the value state can hold.
- All Implemented Interfaces:
Serializable
@Experimental public class ValueStateDescriptor<T> extends StateDescriptor<T>
StateDescriptorforValueState. This can be used to create partitioned value state internally.- 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 ValueStateDescriptor(String stateId, Class<T> typeClass)Creates a newValueStateDescriptorwith the given name and typeValueStateDescriptor(String stateId, TypeInformation<T> typeInfo)Creates a newValueStateDescriptorwith the given stateId and type.ValueStateDescriptor(String stateId, TypeSerializer<T> serializer)Create a newValueStateDescriptorwith the given stateId and the given type serializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
ValueStateDescriptor
public ValueStateDescriptor(@Nonnull String stateId, @Nonnull TypeInformation<T> typeInfo)Creates a newValueStateDescriptorwith the given stateId and type.- Parameters:
stateId- The (unique) stateId for the state.typeInfo- The type of the values in the state.
-
ValueStateDescriptor
public ValueStateDescriptor(@Nonnull String stateId, @Nonnull TypeSerializer<T> serializer)Create a newValueStateDescriptorwith 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.
-
ValueStateDescriptor
public ValueStateDescriptor(@Nonnull String stateId, @Nonnull Class<T> typeClass)Creates a newValueStateDescriptorwith the given name and typeIf this constructor fails (because it is not possible to describe the type via a class), consider using the
ValueStateDescriptor(String, TypeInformation)constructor.- Parameters:
stateId- The (unique) name for the state.typeClass- The type of the values in the state.
-
-
Method Detail
-
getType
public StateDescriptor.Type getType()
Description copied from class:StateDescriptorReturn the specificTypeof described state.- Specified by:
getTypein classStateDescriptor<T>
-
-