T
- Type of the value in the state.@Experimental public interface ValueState<T> extends State
State
interface for partitioned single-value state. The value can be retrieved or
updated.
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> |
asyncUpdate(T value)
Updates the operator state accessible by
asyncValue() to the given value. |
StateFuture<T> |
asyncValue()
Returns the current value for the state asynchronously.
|
asyncClear
StateFuture<T> asyncValue()
asyncUpdate(Object)
, the future will return null
asynchronously.StateFuture
that will return the value corresponding to the current
input.StateFuture<Void> asyncUpdate(T value)
asyncValue()
to the given value. The next
time asyncValue()
is called (for the same state partition) the returned state will
represent the updated value. When a partitioned state is updated with null
, the state
for the current key will be removed.value
- The new value for the state.StateFuture
that will trigger the callback when update finishes.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.