public class DefaultStateManager extends Object implements org.apache.flink.datastream.api.context.StateManager
StateManager. This class supports eagerly set and reset the
current key.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.streaming.api.operators.StreamingRuntimeContext |
operatorContext |
protected org.apache.flink.api.common.state.OperatorStateStore |
operatorStateStore |
| Constructor and Description |
|---|
DefaultStateManager(Supplier<Object> currentKeySupplier,
Consumer<Object> currentKeySetter,
org.apache.flink.streaming.api.operators.StreamingRuntimeContext operatorContext,
org.apache.flink.api.common.state.OperatorStateStore operatorStateStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
executeInKeyContext(Runnable runnable,
Object key)
This method should be used to run a block of code with a specific key context.
|
<K> K |
getCurrentKey() |
<IN,ACC,OUT> |
getState(org.apache.flink.api.common.state.AggregatingStateDeclaration<IN,ACC,OUT> stateDeclaration) |
<K,V> Optional<org.apache.flink.api.common.state.BroadcastState<K,V>> |
getState(org.apache.flink.api.common.state.BroadcastStateDeclaration<K,V> stateDeclaration) |
<T> Optional<org.apache.flink.api.common.state.ListState<T>> |
getState(org.apache.flink.api.common.state.ListStateDeclaration<T> stateDeclaration) |
<K,V> Optional<org.apache.flink.api.common.state.MapState<K,V>> |
getState(org.apache.flink.api.common.state.MapStateDeclaration<K,V> stateDeclaration) |
<T> Optional<org.apache.flink.api.common.state.ReducingState<T>> |
getState(org.apache.flink.api.common.state.ReducingStateDeclaration<T> stateDeclaration) |
<T> Optional<org.apache.flink.api.common.state.ValueState<T>> |
getState(org.apache.flink.api.common.state.ValueStateDeclaration<T> stateDeclaration) |
protected final org.apache.flink.streaming.api.operators.StreamingRuntimeContext operatorContext
protected final org.apache.flink.api.common.state.OperatorStateStore operatorStateStore
public <K> K getCurrentKey()
getCurrentKey in interface org.apache.flink.datastream.api.context.StateManagerpublic <T> Optional<org.apache.flink.api.common.state.ValueState<T>> getState(org.apache.flink.api.common.state.ValueStateDeclaration<T> stateDeclaration) throws Exception
getState in interface org.apache.flink.datastream.api.context.StateManagerExceptionpublic <T> Optional<org.apache.flink.api.common.state.ListState<T>> getState(org.apache.flink.api.common.state.ListStateDeclaration<T> stateDeclaration) throws Exception
getState in interface org.apache.flink.datastream.api.context.StateManagerExceptionpublic <K,V> Optional<org.apache.flink.api.common.state.MapState<K,V>> getState(org.apache.flink.api.common.state.MapStateDeclaration<K,V> stateDeclaration) throws Exception
getState in interface org.apache.flink.datastream.api.context.StateManagerExceptionpublic <T> Optional<org.apache.flink.api.common.state.ReducingState<T>> getState(org.apache.flink.api.common.state.ReducingStateDeclaration<T> stateDeclaration) throws Exception
getState in interface org.apache.flink.datastream.api.context.StateManagerExceptionpublic <IN,ACC,OUT> Optional<org.apache.flink.api.common.state.AggregatingState<IN,OUT>> getState(org.apache.flink.api.common.state.AggregatingStateDeclaration<IN,ACC,OUT> stateDeclaration) throws Exception
getState in interface org.apache.flink.datastream.api.context.StateManagerExceptionpublic <K,V> Optional<org.apache.flink.api.common.state.BroadcastState<K,V>> getState(org.apache.flink.api.common.state.BroadcastStateDeclaration<K,V> stateDeclaration) throws Exception
getState in interface org.apache.flink.datastream.api.context.StateManagerExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.