T - The type of the value of the state object described by this state descriptor.@Internal public abstract class StateDescriptor<T> extends Object implements Serializable
StateDescriptor is used for creating partitioned
State in stateful operations internally.| Modifier and Type | Class and Description |
|---|---|
static class |
StateDescriptor.Type
An enumeration of the types of supported states.
|
| Modifier | Constructor and Description |
|---|---|
protected |
StateDescriptor(String stateId,
org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
Create a new
StateDescriptor 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 new
StateDescriptor with the given stateId and the given type information. |
| Modifier and Type | Method and 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 specific
Type of described state. |
int |
hashCode() |
String |
toString() |
protected StateDescriptor(@Nonnull String stateId, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
StateDescriptor with the given stateId and the given type information.stateId - The stateId of the StateDescriptor.typeInfo - The type information for the values in the state.protected StateDescriptor(@Nonnull String stateId, @Nonnull org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo, org.apache.flink.api.common.serialization.SerializerConfig serializerConfig)
StateDescriptor with the given stateId and the given type information.stateId - The stateId of the StateDescriptor.typeInfo - The type information for the values in the state.serializerConfig - The serializer related config used to generate TypeSerializer.public void enableTimeToLive(org.apache.flink.api.common.state.StateTtlConfig ttlConfig)
State user value will expire, become unavailable and be cleaned up in storage depending on
configured StateTtlConfig.
ttlConfig - configuration of state TTL@Nonnull public org.apache.flink.api.common.state.StateTtlConfig getTtlConfig()
@Nonnull public org.apache.flink.api.common.typeutils.TypeSerializer<T> getSerializer()
public abstract StateDescriptor.Type getType()
Type of described state.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.