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)
.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 . |
equals, getDefaultValue, getName, getSerializer, hashCode, initializeSerializerUnlessSet, isSerializerInitialized, toString
public 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
StateDescriptor
State
on the given StateBackend
.bind
in class StateDescriptor<ValueState<T>,T>
stateBackend
- The StateBackend
on which to create the State
.Exception
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.