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,
TypeInformation<T> typeInfo)
Create a new
StateDescriptor with the given stateId and the given type information. |
protected |
StateDescriptor(String stateId,
TypeInformation<T> typeInfo,
SerializerConfig serializerConfig)
Create a new
StateDescriptor with the given stateId and the given type information. |
Modifier and Type | Method and Description |
---|---|
void |
enableTimeToLive(StateTtlConfig ttlConfig)
Configures optional activation of state time-to-live (TTL).
|
boolean |
equals(Object o) |
TypeSerializer<T> |
getSerializer() |
String |
getStateId() |
StateTtlConfig |
getTtlConfig() |
abstract StateDescriptor.Type |
getType()
Return the specific
Type of described state. |
int |
hashCode() |
String |
toString() |
protected StateDescriptor(@Nonnull String stateId, 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 TypeInformation<T> typeInfo, 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(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 StateTtlConfig getTtlConfig()
@Nonnull public TypeSerializer<T> getSerializer()
public abstract StateDescriptor.Type getType()
Type
of described state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.