Class AbstractReducingState<K,N,V>
- java.lang.Object
-
- org.apache.flink.runtime.state.v2.AbstractKeyedState<K,N,V>
-
- org.apache.flink.runtime.state.v2.AbstractReducingState<K,N,V>
-
- Type Parameters:
K- The type of key the state is associated to.V- The type of values kept internally in state.
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.AggregatingState<V,V>,org.apache.flink.api.common.state.v2.AppendingState<V,V,V>,org.apache.flink.api.common.state.v2.MergingState<V,V,V>,org.apache.flink.api.common.state.v2.ReducingState<V>,org.apache.flink.api.common.state.v2.State,InternalAggregatingState<K,N,V,V,V>,InternalAppendingState<K,N,V,V,V,V>,InternalKeyedState<K,N,V>,InternalMergingState<K,N,V,V,V,V>,InternalPartitionedState<N>,InternalReducingState<K,N,V>,InternalStateAccessible<V>
public class AbstractReducingState<K,N,V> extends AbstractKeyedState<K,N,V> implements InternalReducingState<K,N,V>
A default implementation ofReducingStatewhich delegates all async requests toStateRequestHandler.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.api.common.functions.ReduceFunction<V>reduceFunction-
Fields inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
stateRequestHandler
-
-
Constructor Summary
Constructors Constructor Description AbstractReducingState(StateRequestHandler stateRequestHandler, org.apache.flink.api.common.functions.ReduceFunction<V> reduceFunction, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(V value)org.apache.flink.api.common.state.v2.StateFuture<Void>asyncAdd(V value)org.apache.flink.api.common.state.v2.StateFuture<V>asyncGet()org.apache.flink.api.common.state.v2.StateFuture<V>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(V valueToStore)Update internally stored value.Vget()VgetInternal()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(V 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
-
-
-
-
Field Detail
-
reduceFunction
protected final org.apache.flink.api.common.functions.ReduceFunction<V> reduceFunction
-
-
Constructor Detail
-
AbstractReducingState
public AbstractReducingState(StateRequestHandler stateRequestHandler, org.apache.flink.api.common.functions.ReduceFunction<V> reduceFunction, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
-
-
Method Detail
-
asyncGet
public org.apache.flink.api.common.state.v2.StateFuture<V> asyncGet()
-
get
public V get()
-
add
public void add(V 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,V,V,V,V>- 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,V,V,V,V>- Parameters:
target- The target namespace where the merged state should be stored.sources- The source namespaces whose state should be merged.
-
asyncGetInternal
public org.apache.flink.api.common.state.v2.StateFuture<V> 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(V valueToStore)
Description copied from interface:InternalStateAccessibleUpdate internally stored value.- Specified by:
asyncUpdateInternalin interfaceInternalStateAccessible<K>- Parameters:
valueToStore- new value to store.
-
getInternal
public V getInternal()
Description copied from interface:InternalStateAccessibleGet internally stored value.- Specified by:
getInternalin interfaceInternalStateAccessible<K>- Returns:
- internally stored value.
-
updateInternal
public void updateInternal(V valueToStore)
Description copied from interface:InternalStateAccessibleUpdate internally stored value.- Specified by:
updateInternalin interfaceInternalStateAccessible<K>- Parameters:
valueToStore- new value to store.
-
-