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.public class InternalAggregatingState<K,IN,ACC,OUT> extends InternalKeyedState<K,ACC> implements AggregatingState<IN,OUT>
AggregatingState
, which delegates all async requests to
StateRequestHandler
.Modifier and Type | Field and Description |
---|---|
protected AggregateFunction<IN,ACC,OUT> |
aggregateFunction |
Constructor and Description |
---|
InternalAggregatingState(StateRequestHandler stateRequestHandler,
AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor)
Creates a new InternalKeyedState with the given asyncExecutionController and stateDescriptor.
|
Modifier and Type | Method and Description |
---|---|
StateFuture<Void> |
asyncAdd(IN value)
Updates the operator state accessible by
AppendingState.asyncGet() by adding the given value to the
list of values. |
StateFuture<OUT> |
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 AggregateFunction<IN,ACC,OUT> aggregateFunction
public InternalAggregatingState(StateRequestHandler stateRequestHandler, AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor)
stateRequestHandler
- The async request handler for handling all requests.stateDescriptor
- The properties of the state.public StateFuture<OUT> asyncGet()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null
wrapped by a StateFuture.
asyncGet
in interface AppendingState<IN,OUT>
null
wrapped
by a StateFuture
if the state is empty.public StateFuture<Void> asyncAdd(IN 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<IN,OUT>
value
- The new value for the state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.