public final class ImmutableListState<V> extends Object implements ListState<V>
ListState
that does not allow for modifications.
This is the result returned when querying Flink's keyed state using the Queryable State Client
and providing
an ListStateDescriptor
.
Modifier and Type | Field and Description |
---|---|
protected static UnsupportedOperationException |
MODIFICATION_ATTEMPT_ERROR |
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. |
void |
clear()
Removes the value mapped under the current key.
|
static <V,T,S extends State> |
createState(StateDescriptor<S,T> stateDescriptor,
byte[] serializedState) |
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 to the
given list of values. |
protected static final UnsupportedOperationException MODIFICATION_ATTEMPT_ERROR
public Iterable<V> get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null
.
get
in interface AppendingState<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 state value will remain unchanged.
add
in interface AppendingState<V,Iterable<V>>
value
- The new value for the state.public void clear()
State
public void update(List<V> values)
ListState
AppendingState.get()
by updating existing values to 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 null or an empty list is passed in, the state value will be null.
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 null or an empty list is passed in, the state value remains unchanged.
public static <V,T,S extends State> S createState(StateDescriptor<S,T> stateDescriptor, byte[] serializedState) throws IOException
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.