K
- The type of key the state is associated to.V
- The type of values kept internally in state.public class InternalListState<K,N,V> extends InternalKeyedState<K,N,V> implements ListState<V>
ListState
which delegates all async requests to StateRequestHandler
.stateRequestHandler
Constructor and Description |
---|
InternalListState(StateRequestHandler stateRequestHandler,
ListStateDescriptor<V> stateDescriptor) |
Modifier and Type | Method and Description |
---|---|
void |
add(V value)
Updates the operator state accessible by
AppendingState.get() by adding the given value to the list
of values. |
void |
addAll(List<V> values)
Updates the operator state accessible by
AppendingState.get() by adding the given values to
existing list of values. |
StateFuture<Void> |
asyncAdd(V value)
Updates the operator state accessible by
AppendingState.asyncGet() by adding the given value to the
list of values asynchronously. |
StateFuture<Void> |
asyncAddAll(List<V> values)
Updates the operator state accessible by
AppendingState.asyncGet() by adding the given values to
existing list of values asynchronously. |
StateFuture<StateIterator<V>> |
asyncGet()
Returns the current value for the state asynchronously.
|
StateFuture<Void> |
asyncUpdate(List<V> values)
Updates the operator state accessible by
AppendingState.asyncGet() by updating existing values to
the given list of values asynchronously. |
Iterable<V> |
get()
Returns the current value for the state.
|
void |
update(List<V> values)
Updates the operator state accessible by
AppendingState.get() by updating existing values to the
given list of values. |
asyncClear, clear, getStateDescriptor, getStateRequestHandler, getValueSerializer, handleRequest, handleRequestSync, setCurrentNamespace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asyncClear, clear
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>,Iterable<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 asynchronously. 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>,Iterable<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 asynchronously. 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 asynchronously. 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.public Iterable<V> get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null
.
get
in interface AppendingState<V,StateIterator<V>,Iterable<V>>
null
if the
state is empty.public void add(V value)
AppendingState
AppendingState.get()
by adding the given value to the list
of values. The next time AppendingState.get()
is called (for the same state partition) the returned
state will represent the updated list.
If null is passed in, the behaviour is undefined (implementation related).
add
in interface AppendingState<V,StateIterator<V>,Iterable<V>>
value
- The new value for the state.public void update(List<V> values)
ListState
AppendingState.get()
by updating existing values to the
given list of values. The next time AppendingState.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.
public void addAll(List<V> values)
ListState
AppendingState.get()
by adding the given values to
existing list of values. The next time AppendingState.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.
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.