S
- the type of an operator state partition.public final class PartitionableListState<S> extends Object implements ListState<S>
Modifier and Type | Method and Description |
---|---|
void |
add(S value)
Updates the operator state accessible by
AppendingState.get() by adding the given value to the list
of values. |
void |
addAll(List<S> 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.
|
PartitionableListState<S> |
deepCopy() |
Iterable<S> |
get()
Returns the current value for the state.
|
ArrayListSerializer<S> |
getInternalListCopySerializer() |
RegisteredOperatorStateBackendMetaInfo<S> |
getStateMetaInfo() |
void |
setStateMetaInfo(RegisteredOperatorStateBackendMetaInfo<S> stateMetaInfo) |
String |
toString() |
void |
update(List<S> values)
Updates the operator state accessible by
AppendingState.get() by updating existing values to the
given list of values. |
long[] |
write(FSDataOutputStream out) |
public void setStateMetaInfo(RegisteredOperatorStateBackendMetaInfo<S> stateMetaInfo)
public RegisteredOperatorStateBackendMetaInfo<S> getStateMetaInfo()
public PartitionableListState<S> deepCopy()
public void clear()
State
public Iterable<S> get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method should return null
.
get
in interface AppendingState<S,Iterable<S>>
null
if the
state is empty.public void add(S 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<S,Iterable<S>>
value
- The new value for the state.public long[] write(FSDataOutputStream out) throws IOException
IOException
public void update(List<S> 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 null or an empty list is passed in, the state value will be null.
public void addAll(List<S> 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.
@VisibleForTesting public ArrayListSerializer<S> getInternalListCopySerializer()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.