@PublicEvolving public final class ImmutableAggregatingState<IN,OUT> extends Object implements AggregatingState<IN,OUT>
AggregatingState
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 an AggregatingStateDescriptor
.
Modifier and Type | Field and Description |
---|---|
protected static UnsupportedOperationException |
MODIFICATION_ATTEMPT_ERROR |
Modifier and Type | Method and Description |
---|---|
void |
add(Object 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 <IN,ACC,OUT> |
createState(AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor,
byte[] serializedValue) |
OUT |
get()
Returns the current value for the state.
|
protected static final UnsupportedOperationException MODIFICATION_ATTEMPT_ERROR
public OUT get()
AppendingState
NOTE TO IMPLEMENTERS: if the state is empty, then this method
should return null
.
get
in interface AppendingState<IN,OUT>
null
if the state is empty.public void add(Object 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<IN,OUT>
newValue
- The new value for the state.public void clear()
State
public static <IN,ACC,OUT> ImmutableAggregatingState<IN,OUT> createState(AggregatingStateDescriptor<IN,ACC,OUT> stateDescriptor, byte[] serializedValue) throws IOException
IOException
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.