Class StateDescriptor<T>
- java.lang.Object
-
- org.apache.flink.runtime.state.v2.StateDescriptor<T>
-
- Type Parameters:
T- The type of the value of the state object described by this state descriptor.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AggregatingStateDescriptor,ListStateDescriptor,MapStateDescriptor,ReducingStateDescriptor,ValueStateDescriptor
@Internal public abstract class StateDescriptor<T> extends Object implements Serializable
Base class for state descriptors. AStateDescriptoris used for creating partitioned State in stateful operations internally.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStateDescriptor.TypeAn enumeration of the types of supported states.
-
Constructor Summary
Constructors Modifier Constructor Description protectedStateDescriptor(String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)Create a newStateDescriptorwith the given stateId and the given type information.protectedStateDescriptor(String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo, org.apache.flink.api.common.serialization.SerializerConfig serializerConfig)Create a newStateDescriptorwith the given stateId and the given type information.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidenableTimeToLive(org.apache.flink.api.common.state.StateTtlConfig ttlConfig)Configures optional activation of state time-to-live (TTL).booleanequals(Object o)org.apache.flink.api.common.typeutils.TypeSerializer<T>getSerializer()StringgetStateId()org.apache.flink.api.common.state.StateTtlConfiggetTtlConfig()abstract StateDescriptor.TypegetType()Return the specificTypeof described state.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
StateDescriptor
protected StateDescriptor(@Nonnull String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)Create a newStateDescriptorwith the given stateId and the given type information.- Parameters:
stateId- The stateId of theStateDescriptor.typeInfo- The type information for the values in the state.
-
StateDescriptor
protected StateDescriptor(@Nonnull String stateId, @Nonnull org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo, org.apache.flink.api.common.serialization.SerializerConfig serializerConfig)Create a newStateDescriptorwith the given stateId and the given type information.- Parameters:
stateId- The stateId of theStateDescriptor.typeInfo- The type information for the values in the state.serializerConfig- The serializer related config used to generateTypeSerializer.
-
-
Method Detail
-
enableTimeToLive
public void enableTimeToLive(org.apache.flink.api.common.state.StateTtlConfig ttlConfig)
Configures optional activation of state time-to-live (TTL).State user value will expire, become unavailable and be cleaned up in storage depending on configured
StateTtlConfig.- Parameters:
ttlConfig- configuration of state TTL
-
getTtlConfig
@Nonnull public org.apache.flink.api.common.state.StateTtlConfig getTtlConfig()
-
getStateId
@Nonnull public String getStateId()
-
getSerializer
@Nonnull public org.apache.flink.api.common.typeutils.TypeSerializer<T> getSerializer()
-
getType
public abstract StateDescriptor.Type getType()
Return the specificTypeof described state.
-
-