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.TypedefaultValue, name, serializer| Constructor and Description |
|---|
ValueStateDescriptor(String name,
Class<T> typeClass)
Creates a new
ValueStateDescriptor with the given name and type |
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 |
|---|---|
ValueState<T> |
bind(StateBinder stateBinder)
Creates a new
State on the given StateBinder. |
boolean |
equals(Object o) |
StateDescriptor.Type |
getType() |
int |
hashCode() |
String |
toString() |
getDefaultValue, getName, getQueryableStateName, getSerializer, initializeSerializerUnlessSet, isQueryable, isSerializerInitialized, setQueryable@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 ValueState<T> bind(StateBinder stateBinder) throws Exception
StateDescriptorState on the given StateBinder.bind in class StateDescriptor<ValueState<T>,T>stateBinder - The StateBackend on which to create the State.Exceptionpublic boolean equals(Object o)
equals in class StateDescriptor<ValueState<T>,T>public int hashCode()
hashCode in class StateDescriptor<ValueState<T>,T>public String toString()
toString in class StateDescriptor<ValueState<T>,T>public StateDescriptor.Type getType()
getType in class StateDescriptor<ValueState<T>,T>Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.