@PublicEvolving 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 |
clear()
Removes the value mapped under the current key.
|
static <V> ImmutableListState<V> |
createState(ListStateDescriptor<V> stateDescriptor,
byte[] serializedState) |
Iterable<V> |
get()
Returns the current value for the state.
|
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.add
in interface AppendingState<V,Iterable<V>>
value
- The new value for the state.public void clear()
State
public static <V> ImmutableListState<V> createState(ListStateDescriptor<V> stateDescriptor, byte[] serializedState) throws IOException
IOException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.