K
- The type of the key.N
- The type of the namespace.V
- The type of the value.public class MemValueState<K,N,V> extends AbstractMemState<K,N,V,ValueState<V>,ValueStateDescriptor<V>> implements ValueState<V>
Modifier and Type | Class and Description |
---|---|
static class |
MemValueState.Snapshot<K,N,V> |
currentKey, currentNamespace, currentNSState, keySerializer, namespaceSerializer, state, stateDesc, stateSerializer
Constructor and Description |
---|
MemValueState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
ValueStateDescriptor<V> stateDesc) |
MemValueState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
ValueStateDescriptor<V> stateDesc,
HashMap<N,Map<K,V>> state) |
Modifier and Type | Method and Description |
---|---|
KvStateSnapshot<K,N,ValueState<V>,ValueStateDescriptor<V>,MemoryStateBackend> |
createHeapSnapshot(byte[] bytes) |
void |
update(V value)
Updates the operator state accessible by
ValueState.value() to the given
value. |
V |
value()
Returns the current value for the state.
|
snapshot
clear, dispose, getKeySerializer, getNamespaceSerializer, setCurrentKey, setCurrentNamespace, size
public MemValueState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, ValueStateDescriptor<V> stateDesc)
public MemValueState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, ValueStateDescriptor<V> stateDesc, HashMap<N,Map<K,V>> state)
public V value()
ValueState
value
in interface OperatorState<V>
value
in interface ValueState<V>
public void update(V value)
ValueState
ValueState.value()
to the given
value. The next time ValueState.value()
is called (for the same state
partition) the returned state will represent the updated value. When a
partitioned state is updated with null, the state for the current key
will be removed and the default value is returned on the next access.update
in interface OperatorState<V>
update
in interface ValueState<V>
value
- The new value for the state.public KvStateSnapshot<K,N,ValueState<V>,ValueStateDescriptor<V>,MemoryStateBackend> createHeapSnapshot(byte[] bytes)
createHeapSnapshot
in class AbstractMemState<K,N,V,ValueState<V>,ValueStateDescriptor<V>>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.