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. AStateDescriptor
is used for creating partitioned State in stateful operations internally.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StateDescriptor.Type
An enumeration of the types of supported states.
-
Constructor Summary
Constructors Modifier Constructor Description protected
StateDescriptor(String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
Create a newStateDescriptor
with the given stateId and the given type information.protected
StateDescriptor(String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo, org.apache.flink.api.common.serialization.SerializerConfig serializerConfig)
Create a newStateDescriptor
with the given stateId and the given type information.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
enableTimeToLive(org.apache.flink.api.common.state.StateTtlConfig ttlConfig)
Configures optional activation of state time-to-live (TTL).boolean
equals(Object o)
org.apache.flink.api.common.typeutils.TypeSerializer<T>
getSerializer()
String
getStateId()
org.apache.flink.api.common.state.StateTtlConfig
getTtlConfig()
abstract StateDescriptor.Type
getType()
Return the specificType
of described state.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
StateDescriptor
protected StateDescriptor(@Nonnull String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
Create a newStateDescriptor
with 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 newStateDescriptor
with 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 specificType
of described state.
-
-