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>
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, AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor)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()protected org.apache.flink.api.common.state.v2.StateFuture<ACC>asyncGetAccumulator()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.OUTget()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.-
Methods inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
asyncClear, clear, getStateDescriptor, 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, AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor)
Creates a new AbstractKeyedState with the given asyncExecutionController and stateDescriptor.- Parameters:
stateRequestHandler- The async request handler for handling all requests.stateDescriptor- The properties of the state.
-
-
Method Detail
-
asyncGetAccumulator
protected org.apache.flink.api.common.state.v2.StateFuture<ACC> asyncGetAccumulator()
-
asyncGet
public org.apache.flink.api.common.state.v2.StateFuture<OUT> asyncGet()
-
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.
-
-