IN
- Type of the value that can be added to the state.OUT
- Type of the value that can be retrieved from the state.@Experimental public interface AppendingState<IN,OUT> extends State
The state is accessed and modified by user functions, and checkpointed consistently by the system as part of the distributed snapshots.
The state is only accessible by functions applied on a KeyedStream
. The key is
automatically supplied by the system, so the function always sees the value mapped to the key of
the current element. That way, the system can handle stream and state partitioning consistently
together.
Modifier and Type | Method and Description |
---|---|
StateFuture<Void> |
asyncAdd(IN value)
Updates the operator state accessible by
asyncGet() by adding the given value to the
list of values. |
StateFuture<OUT> |
asyncGet()
Returns the current value for the state.
|
asyncClear
StateFuture<OUT> asyncGet()
NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null
wrapped by a StateFuture.
null
wrapped
by a StateFuture
if the state is empty.StateFuture<Void> asyncAdd(IN value)
asyncGet()
by adding the given value to the
list of values. The next time 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.
value
- The new value for the state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.