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).defaultValue, name, serializer| Constructor and Description |
|---|
ValueStateDescriptor(String name,
Class<T> typeClass,
T defaultValue)
Creates a new
ValueStateDescriptor with the given name, type, and default value. |
ValueStateDescriptor(String name,
TypeInformation<T> typeInfo,
T defaultValue)
Creates a new
ValueStateDescriptor with the given name and default value. |
ValueStateDescriptor(String name,
TypeSerializer<T> typeSerializer,
T defaultValue)
Creates a new
ValueStateDescriptor with the given name, default value, and the specific
serializer. |
| Modifier and Type | Method and Description |
|---|---|
ValueState<T> |
bind(StateBackend stateBackend)
Creates a new
State on the given StateBackend. |
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
getDefaultValue, getName, getSerializer, initializeSerializerUnlessSet, isSerializerInitializedpublic ValueStateDescriptor(String name, Class<T> typeClass, T defaultValue)
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.public ValueStateDescriptor(String name, TypeInformation<T> typeInfo, T defaultValue)
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.public ValueStateDescriptor(String name, TypeSerializer<T> typeSerializer, T defaultValue)
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 ValueState<T> bind(StateBackend stateBackend) throws Exception
StateDescriptorState on the given StateBackend.bind in class StateDescriptor<ValueState<T>,T>stateBackend - 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>Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.