K
- The type of the key.N
- The type of the namespace.IN
- The type of the input elements.SV
- The type of the values in the state.OUT
- The type of the output elements.S
- The type of Statepublic abstract class AbstractHeapMergingState<K,N,IN,SV,OUT,S extends State> extends AbstractHeapState<K,N,SV,S> implements InternalMergingState<K,N,IN,SV,OUT>
MergingState
(InternalMergingState
) that is stored on the heap.currentNamespace, keySerializer, namespaceSerializer, stateTable, valueSerializer
Modifier | Constructor and Description |
---|---|
protected |
AbstractHeapMergingState(StateTable<K,N,SV> stateTable,
TypeSerializer<K> keySerializer,
TypeSerializer<SV> valueSerializer,
TypeSerializer<N> namespaceSerializer,
SV defaultValue)
Creates a new key/value state for the given hash map of key/value pairs.
|
Modifier and Type | Method and Description |
---|---|
void |
mergeNamespaces(N target,
Collection<N> sources)
Merges the state of the current key for the given source namespaces into the state of
the target namespace.
|
protected abstract SV |
mergeState(SV a,
SV b) |
clear, getDefaultValue, getSerializedValue, getStateTable, setCurrentNamespace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKeySerializer, getNamespaceSerializer, getSerializedValue, getValueSerializer, setCurrentNamespace
add, get
protected AbstractHeapMergingState(StateTable<K,N,SV> stateTable, TypeSerializer<K> keySerializer, TypeSerializer<SV> valueSerializer, TypeSerializer<N> namespaceSerializer, SV defaultValue)
stateTable
- The state table for which this state is associated to.keySerializer
- The serializer for the keys.valueSerializer
- The serializer for the state.namespaceSerializer
- The serializer for the namespace.defaultValue
- The default value for the state.public void mergeNamespaces(N target, Collection<N> sources) throws Exception
InternalMergingState
mergeNamespaces
in interface InternalMergingState<K,N,IN,SV,OUT>
target
- The target namespace where the merged state should be stored.sources
- The source namespaces whose state should be merged.Exception
- The method may forward exception thrown internally (by I/O or functions).Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.