Class AbstractAggregatingState<K,N,IN,ACC,OUT>
- java.lang.Object
-
- org.apache.flink.runtime.state.v2.AbstractKeyedState<K,N,ACC>
-
- org.apache.flink.runtime.state.v2.AbstractAggregatingState<K,N,IN,ACC,OUT>
-
- Type Parameters:
K- The type of key the state is associated to.IN- The type of the values that are added into the state.ACC- TThe type of the accumulator (intermediate aggregation state).OUT- The type of the values that are returned from the state.
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.AggregatingState<IN,OUT>,org.apache.flink.api.common.state.v2.AppendingState<IN,OUT,OUT>,org.apache.flink.api.common.state.v2.MergingState<IN,OUT,OUT>,org.apache.flink.api.common.state.v2.State,InternalAggregatingState<K,N,IN,ACC,OUT>,InternalAppendingState<K,N,IN,ACC,OUT,OUT>,InternalKeyedState<K,N,ACC>,InternalMergingState<K,N,IN,ACC,OUT,OUT>,InternalPartitionedState<N>,InternalStateAccessible<ACC>
public class AbstractAggregatingState<K,N,IN,ACC,OUT> extends AbstractKeyedState<K,N,ACC> implements InternalAggregatingState<K,N,IN,ACC,OUT>
The default implementation ofAggregatingState, which delegates all async requests toStateRequestHandler.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT>aggregateFunction-
Fields inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
stateRequestHandler
-
-
Constructor Summary
Constructors Constructor Description AbstractAggregatingState(StateRequestHandler stateRequestHandler, org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> aggregateFunction, org.apache.flink.api.common.typeutils.TypeSerializer<ACC> valueSerializer)Creates a new AbstractKeyedState with the given asyncExecutionController and stateDescriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(IN value)org.apache.flink.api.common.state.v2.StateFuture<Void>asyncAdd(IN value)org.apache.flink.api.common.state.v2.StateFuture<OUT>asyncGet()org.apache.flink.api.common.state.v2.StateFuture<ACC>asyncGetInternal()Get internally stored value.org.apache.flink.api.common.state.v2.StateFuture<Void>asyncMergeNamespaces(N target, Collection<N> sources)Merges the state of the current key for the given source namespaces into the state of the target namespace.org.apache.flink.api.common.state.v2.StateFuture<Void>asyncUpdateInternal(ACC valueToStore)Update internally stored value.OUTget()ACCgetInternal()Get internally stored value.voidmergeNamespaces(N target, Collection<N> sources)Merges the state of the current key for the given source namespaces into the state of the target namespace.voidupdateInternal(ACC valueToStore)Update internally stored value.-
Methods inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
asyncClear, clear, getStateRequestHandler, getValueSerializer, handleRequest, handleRequestSync, setCurrentNamespace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.state.v2.internal.InternalPartitionedState
setCurrentNamespace
-
-
-
-
Constructor Detail
-
AbstractAggregatingState
public AbstractAggregatingState(StateRequestHandler stateRequestHandler, org.apache.flink.api.common.functions.AggregateFunction<IN,ACC,OUT> aggregateFunction, org.apache.flink.api.common.typeutils.TypeSerializer<ACC> valueSerializer)
Creates a new AbstractKeyedState with the given asyncExecutionController and stateDescriptor.- Parameters:
stateRequestHandler- The async request handler for handling all requests.valueSerializer- The type serializer for the values in the state.
-
-
Method Detail
-
asyncGet
public org.apache.flink.api.common.state.v2.StateFuture<OUT> asyncGet()
-
asyncGetInternal
public org.apache.flink.api.common.state.v2.StateFuture<ACC> asyncGetInternal()
Description copied from interface:InternalStateAccessibleGet internally stored value.- Specified by:
asyncGetInternalin interfaceInternalStateAccessible<K>- Returns:
- internally stored value.
-
asyncUpdateInternal
public org.apache.flink.api.common.state.v2.StateFuture<Void> asyncUpdateInternal(ACC valueToStore)
Description copied from interface:InternalStateAccessibleUpdate internally stored value.- Specified by:
asyncUpdateInternalin interfaceInternalStateAccessible<K>- Parameters:
valueToStore- new value to store.
-
get
public OUT get()
-
add
public void add(IN value)
-
asyncMergeNamespaces
public org.apache.flink.api.common.state.v2.StateFuture<Void> asyncMergeNamespaces(N target, Collection<N> sources)
Description copied from interface:InternalMergingStateMerges the state of the current key for the given source namespaces into the state of the target namespace.- Specified by:
asyncMergeNamespacesin interfaceInternalMergingState<K,N,IN,ACC,OUT,OUT>- Parameters:
target- The target namespace where the merged state should be stored.sources- The source namespaces whose state should be merged.
-
mergeNamespaces
public void mergeNamespaces(N target, Collection<N> sources)
Description copied from interface:InternalMergingStateMerges the state of the current key for the given source namespaces into the state of the target namespace.- Specified by:
mergeNamespacesin interfaceInternalMergingState<K,N,IN,ACC,OUT,OUT>- Parameters:
target- The target namespace where the merged state should be stored.sources- The source namespaces whose state should be merged.
-
getInternal
public ACC getInternal()
Description copied from interface:InternalStateAccessibleGet internally stored value.- Specified by:
getInternalin interfaceInternalStateAccessible<K>- Returns:
- internally stored value.
-
updateInternal
public void updateInternal(ACC valueToStore)
Description copied from interface:InternalStateAccessibleUpdate internally stored value.- Specified by:
updateInternalin interfaceInternalStateAccessible<K>- Parameters:
valueToStore- new value to store.
-
-