public final class ImmutableReducingState<V> extends Object implements ReducingState<V>
ReducingState
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 ReducingStateDescriptor
.
Modifier and Type | Field and Description |
---|---|
protected static UnsupportedOperationException |
MODIFICATION_ATTEMPT_ERROR |
Modifier and Type | Method and Description |
---|---|
void |
add(V newValue)
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,S extends State> |
createState(StateDescriptor<S,V> stateDescriptor,
byte[] serializedState) |
V |
get()
Returns the current value for the state.
|
protected static final UnsupportedOperationException MODIFICATION_ATTEMPT_ERROR
public V get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method
should return null
.
get
in interface AppendingState<V,V>
null
if the state is empty.public void add(V newValue)
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,V>
newValue
- The new value for the state.public void clear()
State
public static <V,S extends State> S createState(StateDescriptor<S,V> stateDescriptor, byte[] serializedState) throws IOException
IOException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.