K
- The type of key the state is associated to.V
- The type of values kept internally in state.public class InternalListState<K,V> extends InternalKeyedState<K,V> implements ListState<V>
ListState
which delegates all async requests to StateRequestHandler
.Constructor and Description |
---|
InternalListState(StateRequestHandler stateRequestHandler,
ListStateDescriptor<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<Void> |
asyncAddAll(List<V> values)
Updates the operator state accessible by
AppendingState.asyncGet() by adding the given values to
existing list of values. |
StateFuture<StateIterator<V>> |
asyncGet()
Returns the current value for the state.
|
StateFuture<Void> |
asyncUpdate(List<V> values)
Updates the operator state accessible by
AppendingState.asyncGet() by updating existing values to
the given list of values. |
asyncClear, getStateDescriptor, getValueSerializer, handleRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asyncClear
public InternalListState(StateRequestHandler stateRequestHandler, ListStateDescriptor<V> stateDescriptor)
public StateFuture<StateIterator<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,StateIterator<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,StateIterator<V>>
value
- The new value for the state.public StateFuture<Void> asyncUpdate(List<V> values)
ListState
AppendingState.asyncGet()
by updating existing values to
the given list of values. The next time AppendingState.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.
asyncUpdate
in interface ListState<V>
values
- The new values for the state.public StateFuture<Void> asyncAddAll(List<V> values)
ListState
AppendingState.asyncGet()
by adding the given values to
existing list of values. The next time AppendingState.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.
asyncAddAll
in interface ListState<V>
values
- The new values to be added to the state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.