K
- The type of the key.N
- The type of the namespace.V
- The type of the values in the list state.public class MemListState<K,N,V> extends AbstractMemState<K,N,ArrayList<V>,ListState<V>,ListStateDescriptor<V>> implements ListState<V>
ListState
that is snapshotted
into a serialized memory copy.Modifier and Type | Class and Description |
---|---|
static class |
MemListState.Snapshot<K,N,V> |
currentKey, currentNamespace, currentNSState, keySerializer, namespaceSerializer, state, stateDesc, stateSerializer
Constructor and Description |
---|
MemListState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
ListStateDescriptor<V> stateDesc) |
MemListState(TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
ListStateDescriptor<V> stateDesc,
HashMap<N,Map<K,ArrayList<V>>> state) |
Modifier and Type | Method and Description |
---|---|
void |
add(V value)
Updates the operator state accessible by
MergingState.get() by adding the given value
to the list of values. |
KvStateSnapshot<K,N,ListState<V>,ListStateDescriptor<V>,MemoryStateBackend> |
createHeapSnapshot(byte[] bytes) |
Iterable<V> |
get()
Returns the current value for the state.
|
snapshot
clear, dispose, getKeySerializer, getNamespaceSerializer, setCurrentKey, setCurrentNamespace, size
public MemListState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, ListStateDescriptor<V> stateDesc)
public MemListState(TypeSerializer<K> keySerializer, TypeSerializer<N> namespaceSerializer, ListStateDescriptor<V> stateDesc, HashMap<N,Map<K,ArrayList<V>>> state)
public Iterable<V> get()
MergingState
get
in interface MergingState<V,Iterable<V>>
public void add(V value)
MergingState
MergingState.get()
by adding the given value
to the list of values. The next time MergingState.get()
is called (for the same state
partition) the returned state will represent the updated list.add
in interface MergingState<V,Iterable<V>>
value
- The new value for the state.public KvStateSnapshot<K,N,ListState<V>,ListStateDescriptor<V>,MemoryStateBackend> createHeapSnapshot(byte[] bytes)
createHeapSnapshot
in class AbstractMemState<K,N,ArrayList<V>,ListState<V>,ListStateDescriptor<V>>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.