K - The type of the key.N - The type of the namespace.V - The type of the value.public class HeapReducingState<K,N,V> extends AbstractHeapMergingState<K,N,V,V,V,org.apache.flink.api.common.state.ReducingState<V>> implements InternalReducingState<K,N,V>
ReducingState that is snapshotted into files.currentNamespace, keySerializer, namespaceSerializer, stateTable, valueSerializer| Constructor and Description |
|---|
HeapReducingState(StateTable<K,N,V> stateTable,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
V defaultValue,
org.apache.flink.api.common.functions.ReduceFunction<V> reduceFunction)
Creates a new key/value state for the given hash map of key/value pairs.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(V value) |
V |
get() |
org.apache.flink.api.common.typeutils.TypeSerializer<K> |
getKeySerializer()
Returns the
TypeSerializer for the type of key this state is associated to. |
org.apache.flink.api.common.typeutils.TypeSerializer<N> |
getNamespaceSerializer()
Returns the
TypeSerializer for the type of namespace this state is associated to. |
org.apache.flink.api.common.typeutils.TypeSerializer<V> |
getValueSerializer()
Returns the
TypeSerializer for the type of value this state holds. |
protected V |
mergeState(V a,
V b) |
mergeNamespacesclear, getDefaultValue, getSerializedValue, getStateTable, setCurrentNamespaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmergeNamespacesgetSerializedValue, setCurrentNamespacepublic HeapReducingState(StateTable<K,N,V> stateTable, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, V defaultValue, org.apache.flink.api.common.functions.ReduceFunction<V> reduceFunction)
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.reduceFunction - The reduce function used for reducing state.public org.apache.flink.api.common.typeutils.TypeSerializer<K> getKeySerializer()
InternalKvStateTypeSerializer for the type of key this state is associated to.getKeySerializer in interface InternalKvState<K,N,V>public org.apache.flink.api.common.typeutils.TypeSerializer<N> getNamespaceSerializer()
InternalKvStateTypeSerializer for the type of namespace this state is associated to.getNamespaceSerializer in interface InternalKvState<K,N,V>public org.apache.flink.api.common.typeutils.TypeSerializer<V> getValueSerializer()
InternalKvStateTypeSerializer for the type of value this state holds.getValueSerializer in interface InternalKvState<K,N,V>public V get()
public void add(V value) throws IOException
add in interface org.apache.flink.api.common.state.AppendingState<V,V>IOExceptionCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.