T
- The type of the values that the value state can hold.@PublicEvolving public class ValueStateDescriptor<T> extends StateDescriptor<ValueState<T>,T>
StateDescriptor
for ValueState
. This can be used to create partitioned value
state using RuntimeContext.getState(ValueStateDescriptor)
.
If you don't use one of the constructors that set a default value the value that you get when
reading a ValueState
using ValueState.value()
will be null
.
StateDescriptor.Type
defaultValue, name
Constructor and Description |
---|
ValueStateDescriptor(String name,
Class<T> typeClass)
Creates a new
ValueStateDescriptor with the given name and type
If this constructor fails (because it is not possible to describe the type via a class),
consider using the ValueStateDescriptor(String, TypeInformation) constructor. |
ValueStateDescriptor(String name,
Class<T> typeClass,
T defaultValue)
Deprecated.
Use
ValueStateDescriptor(String, Class) instead and manually manage the
default value by checking whether the contents of the state is null . |
ValueStateDescriptor(String name,
TypeInformation<T> typeInfo)
Creates a new
ValueStateDescriptor with the given name and type. |
ValueStateDescriptor(String name,
TypeInformation<T> typeInfo,
T defaultValue)
Deprecated.
Use
ValueStateDescriptor(String, TypeInformation) instead and manually
manage the default value by checking whether the contents of the state is null . |
ValueStateDescriptor(String name,
TypeSerializer<T> typeSerializer)
Creates a new
ValueStateDescriptor with the given name and the specific serializer. |
ValueStateDescriptor(String name,
TypeSerializer<T> typeSerializer,
T defaultValue)
Deprecated.
Use
ValueStateDescriptor(String, TypeSerializer) instead and manually
manage the default value by checking whether the contents of the state is null . |
Modifier and Type | Method and Description |
---|---|
StateDescriptor.Type |
getType() |
enableTimeToLive, equals, getDefaultValue, getName, getQueryableStateName, getSerializer, getTtlConfig, hashCode, initializeSerializerUnlessSet, initializeSerializerUnlessSet, isQueryable, isSerializerInitialized, setQueryable, toString
@Deprecated public ValueStateDescriptor(String name, Class<T> typeClass, T defaultValue)
ValueStateDescriptor(String, Class)
instead and manually manage the
default value by checking whether the contents of the state is null
.ValueStateDescriptor
with the given name, type, and default value.
If this constructor fails (because it is not possible to describe the type via a class),
consider using the ValueStateDescriptor(String, TypeInformation, Object)
constructor.
name
- The (unique) name for the state.typeClass
- The type of the values in the state.defaultValue
- The default value that will be set when requesting state without setting
a value before.@Deprecated public ValueStateDescriptor(String name, TypeInformation<T> typeInfo, T defaultValue)
ValueStateDescriptor(String, TypeInformation)
instead and manually
manage the default value by checking whether the contents of the state is null
.ValueStateDescriptor
with the given name and default value.name
- The (unique) name for the state.typeInfo
- The type of the values in the state.defaultValue
- The default value that will be set when requesting state without setting
a value before.@Deprecated public ValueStateDescriptor(String name, TypeSerializer<T> typeSerializer, T defaultValue)
ValueStateDescriptor(String, TypeSerializer)
instead and manually
manage the default value by checking whether the contents of the state is null
.ValueStateDescriptor
with the given name, default value, and the
specific serializer.name
- The (unique) name for the state.typeSerializer
- The type serializer of the values in the state.defaultValue
- The default value that will be set when requesting state without setting
a value before.public ValueStateDescriptor(String name, Class<T> typeClass)
ValueStateDescriptor
with the given name and type
If this constructor fails (because it is not possible to describe the type via a class),
consider using the ValueStateDescriptor(String, TypeInformation)
constructor.
name
- The (unique) name for the state.typeClass
- The type of the values in the state.public ValueStateDescriptor(String name, TypeInformation<T> typeInfo)
ValueStateDescriptor
with the given name and type.name
- The (unique) name for the state.typeInfo
- The type of the values in the state.public ValueStateDescriptor(String name, TypeSerializer<T> typeSerializer)
ValueStateDescriptor
with the given name and the specific serializer.name
- The (unique) name for the state.typeSerializer
- The type serializer of the values in the state.public StateDescriptor.Type getType()
getType
in class StateDescriptor<ValueState<T>,T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.