Class ReducingStateAdaptor<K,N,V>
- java.lang.Object
-
- org.apache.flink.runtime.state.v2.adaptor.StateAdaptor<K,N,InternalMergingState<K,N,IN,ACC,SYNCOUT>>
-
- org.apache.flink.runtime.state.v2.adaptor.MergingStateAdaptor<K,N,V,V,V,V>
-
- org.apache.flink.runtime.state.v2.adaptor.ReducingStateAdaptor<K,N,V>
-
- All Implemented Interfaces:
AggregatingState<V,V>
,AppendingState<V,V,V>
,MergingState<V,V,V>
,ReducingState<V>
,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>
public class ReducingStateAdaptor<K,N,V> extends MergingStateAdaptor<K,N,V,V,V,V> implements InternalReducingState<K,N,V>
An adaptor that transformsInternalReducingState
intoInternalReducingState
.
-
-
Constructor Summary
Constructors Constructor Description ReducingStateAdaptor(InternalReducingState<K,N,V> reducingState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StateFuture<V>
asyncGet()
Returns the current value for the state asynchronously.StateFuture<V>
asyncGetInternal()
Get internally stored value.StateFuture<Void>
asyncUpdateInternal(V valueToStore)
Update internally stored value.V
getInternal()
Get internally stored value.void
updateInternal(V valueToStore)
Update internally stored value.-
Methods inherited from class org.apache.flink.runtime.state.v2.adaptor.MergingStateAdaptor
add, asyncAdd, asyncMergeNamespaces, get, mergeNamespaces
-
Methods inherited from class org.apache.flink.runtime.state.v2.adaptor.StateAdaptor
asyncClear, clear, 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.api.common.state.v2.AppendingState
add, asyncAdd, get
-
Methods inherited from interface org.apache.flink.runtime.state.v2.internal.InternalMergingState
asyncMergeNamespaces, mergeNamespaces
-
Methods inherited from interface org.apache.flink.runtime.state.v2.internal.InternalPartitionedState
setCurrentNamespace
-
Methods inherited from interface org.apache.flink.api.common.state.v2.State
asyncClear, clear
-
-
-
-
Constructor Detail
-
ReducingStateAdaptor
public ReducingStateAdaptor(InternalReducingState<K,N,V> reducingState)
-
-
Method Detail
-
asyncGet
public StateFuture<V> asyncGet()
Description copied from interface:AppendingState
Returns the current value for the state asynchronously. When the state is not partitioned the returned value is the same for all inputs in a given operator instance. If state partitioning is applied, the value returned depends on the current operator input, as the operator maintains an independent state for each partition.NOTE TO IMPLEMENTERS: if the state is empty, then this method should return
null
wrapped by a StateFuture.- Specified by:
asyncGet
in interfaceAppendingState<K,N,V>
- Returns:
- The operator state value corresponding to the current input or
null
wrapped by aStateFuture
if the state is empty.
-
asyncGetInternal
public StateFuture<V> asyncGetInternal()
Description copied from interface:InternalAppendingState
Get internally stored value.- Specified by:
asyncGetInternal
in interfaceInternalAppendingState<K,N,V,V,V,V>
- Returns:
- internally stored value.
-
asyncUpdateInternal
public StateFuture<Void> asyncUpdateInternal(V valueToStore)
Description copied from interface:InternalAppendingState
Update internally stored value.- Specified by:
asyncUpdateInternal
in interfaceInternalAppendingState<K,N,V,V,V,V>
- Parameters:
valueToStore
- new value to store.
-
getInternal
public V getInternal()
Description copied from interface:InternalAppendingState
Get internally stored value.- Specified by:
getInternal
in interfaceInternalAppendingState<K,N,V,V,V,V>
- Returns:
- internally stored value.
-
updateInternal
public void updateInternal(V valueToStore)
Description copied from interface:InternalAppendingState
Update internally stored value.- Specified by:
updateInternal
in interfaceInternalAppendingState<K,N,V,V,V,V>
- Parameters:
valueToStore
- new value to store.
-
-