Interface ListState<T>
-
- Type Parameters:
T
- Type of values that this list state keeps.
- All Superinterfaces:
AppendingState<T,StateIterator<T>,Iterable<T>>
,MergingState<T,StateIterator<T>,Iterable<T>>
,State
- All Known Subinterfaces:
InternalListState<K,N,V>
- All Known Implementing Classes:
AbstractListState
,ForStListState
,ListStateAdaptor
@Experimental public interface ListState<T> extends MergingState<T,StateIterator<T>,Iterable<T>>
State
interface for partitioned list state in Operations. The state is accessed and modified by user functions, and checkpointed consistently by the system as part of the distributed snapshots.The state can be a keyed list state or an operator list state.
When it is a keyed list state, it is accessed 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.When it is an operator list state, the list is a collection of state items that are independent from each other and eligible for redistribution across operator instances in case of changed operator parallelism.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAll(List<T> values)
Updates the operator state accessible byAppendingState.get()
by adding the given values to existing list of values.StateFuture<Void>
asyncAddAll(List<T> values)
Updates the operator state accessible byAppendingState.asyncGet()
by adding the given values to existing list of values asynchronously.StateFuture<Void>
asyncUpdate(List<T> values)
Updates the operator state accessible byAppendingState.asyncGet()
by updating existing values to the given list of values asynchronously.void
update(List<T> values)
Updates the operator state accessible byAppendingState.get()
by updating existing values to the given list of values.-
Methods inherited from interface org.apache.flink.api.common.state.v2.AppendingState
add, asyncAdd, asyncGet, get
-
Methods inherited from interface org.apache.flink.api.common.state.v2.State
asyncClear, clear
-
-
-
-
Method Detail
-
asyncUpdate
StateFuture<Void> asyncUpdate(List<T> values)
Updates the operator state accessible byAppendingState.asyncGet()
by updating existing values to the given list of values asynchronously. The next timeAppendingState.asyncGet()
is called (for the same state partition) the returned state will represent the updated list.If an empty list is passed in, the state value will be null.
Null value passed in or any null value in list is not allowed.
- Parameters:
values
- The new values for the state.
-
asyncAddAll
StateFuture<Void> asyncAddAll(List<T> values)
Updates the operator state accessible byAppendingState.asyncGet()
by adding the given values to existing list of values asynchronously. The next timeAppendingState.asyncGet()
is called (for the same state partition) the returned state will represent the updated list.If an empty list is passed in, the state value remains unchanged.
Null value passed in or any null value in list is not allowed.
- Parameters:
values
- The new values to be added to the state.
-
update
void update(List<T> values)
Updates the operator state accessible byAppendingState.get()
by updating existing values to the given list of values. The next timeAppendingState.get()
is called (for the same state partition) the returned state will represent the updated list.If an empty list is passed in, the state value will be null.
Null value passed in or any null value in list is not allowed.
- Parameters:
values
- The new values for the state.
-
addAll
void addAll(List<T> values)
Updates the operator state accessible byAppendingState.get()
by adding the given values to existing list of values. The next timeAppendingState.get()
is called (for the same state partition) the returned state will represent the updated list.If an empty list is passed in, the state value remains unchanged.
Null value passed in or any null value in list is not allowed.
- Parameters:
values
- The new values to be added to the state.
-
-