K
- The type of key the state is associated to.V
- The type of values kept internally in state.public class InternalReducingState<K,V> extends InternalKeyedState<K,V> implements ReducingState<V>
ReducingState
which delegates all async requests to StateRequestHandler
.Modifier and Type | Field and Description |
---|---|
protected ReduceFunction<V> |
reduceFunction |
Constructor and Description |
---|
InternalReducingState(StateRequestHandler stateRequestHandler,
ReducingStateDescriptor<V> stateDescriptor) |
Modifier and Type | Method and Description |
---|---|
StateFuture<Void> |
asyncAdd(V value)
Updates the operator state accessible by
AppendingState.asyncGet() by adding the given value to the
list of values. |
StateFuture<V> |
asyncGet()
Returns the current value for the state.
|
asyncClear, getStateDescriptor, getValueSerializer, handleRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asyncClear
protected final ReduceFunction<V> reduceFunction
public InternalReducingState(StateRequestHandler stateRequestHandler, ReducingStateDescriptor<V> stateDescriptor)
public StateFuture<V> asyncGet()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null
wrapped by a StateFuture.
asyncGet
in interface AppendingState<V,V>
null
wrapped
by a StateFuture
if the state is empty.public StateFuture<Void> asyncAdd(V value)
AppendingState
AppendingState.asyncGet()
by adding the given value to the
list of values. The next time AppendingState.asyncGet()
is called (for the same state partition)
the returned state will represent the updated list.
null value is not allowed to be passed in.
asyncAdd
in interface AppendingState<V,V>
value
- The new value for the state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.