Class ImmutableAggregatingState<IN,OUT>
- java.lang.Object
-
- org.apache.flink.queryablestate.client.state.ImmutableAggregatingState<IN,OUT>
-
- All Implemented Interfaces:
AggregatingState<IN,OUT>
,AppendingState<IN,OUT>
,MergingState<IN,OUT>
,State
public final class ImmutableAggregatingState<IN,OUT> extends Object implements AggregatingState<IN,OUT>
A read-onlyAggregatingState
that does not allow for modifications.This is the type of the result returned when querying Flink's keyed state using the
Queryable State Client
and providing anAggregatingStateDescriptor
.
-
-
Field Summary
Fields Modifier and Type Field Description protected static UnsupportedOperationException
MODIFICATION_ATTEMPT_ERROR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Object newValue)
Updates the operator state accessible byAppendingState.get()
by adding the given value to the list of values.void
clear()
Removes the value mapped under the current key.static <OUT,ACC,S extends State>
ScreateState(StateDescriptor<S,ACC> stateDescriptor, byte[] serializedState)
OUT
get()
Returns the current value for the state.
-
-
-
Field Detail
-
MODIFICATION_ATTEMPT_ERROR
protected static final UnsupportedOperationException MODIFICATION_ATTEMPT_ERROR
-
-
Method Detail
-
get
public OUT get()
Description copied from interface:AppendingState
Returns the current value for the state. When the state is not partitioned the returned value is the same for all inputs in a given operator instance. If state partitioning is applied, the value returned depends on the current operator input, as the operator maintains an independent state for each partition.NOTE TO IMPLEMENTERS: if the state is empty, then this method should return
null
.- Specified by:
get
in interfaceAppendingState<IN,OUT>
- Returns:
- The operator state value corresponding to the current input or
null
if the state is empty.
-
add
public void add(Object newValue)
Description copied from interface:AppendingState
Updates the operator state accessible byAppendingState.get()
by adding the given value to the list of values. The next timeAppendingState.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). TODO: An unified behaviour across all sub-classes.
- Specified by:
add
in interfaceAppendingState<IN,OUT>
- Parameters:
newValue
- The new value for the state.
-
clear
public void clear()
Description copied from interface:State
Removes the value mapped under the current key.
-
createState
public static <OUT,ACC,S extends State> S createState(StateDescriptor<S,ACC> stateDescriptor, byte[] serializedState) throws IOException
- Throws:
IOException
-
-