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