Class StateExecutionController<K>
- java.lang.Object
-
- org.apache.flink.runtime.asyncprocessing.AsyncExecutionController<K,StateRequest<?,?,?,?>>
-
- org.apache.flink.runtime.asyncprocessing.StateExecutionController<K>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,StateRequestHandler
public class StateExecutionController<K> extends AsyncExecutionController<K,StateRequest<?,?,?,?>> implements StateRequestHandler
TheStateExecutionController
is responsible for handlingStateRequest
s. It extendsAsyncExecutionController
and implementsStateRequestHandler
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.asyncprocessing.AsyncExecutionController
AsyncExecutionController.SwitchContextListener<K>
-
-
Constructor Summary
Constructors Constructor Description StateExecutionController(org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, org.apache.flink.core.asyncprocessing.AsyncFutureImpl.AsyncFrameworkExceptionHandler exceptionHandler, AsyncExecutor<StateRequest<?,?,?,?>> stateExecutor, DeclarationManager declarationManager, EpochManager.ParallelMode epochParallelMode, int maxParallelism, int batchSize, long bufferTimeout, int maxInFlightRecords, AsyncExecutionController.SwitchContextListener<K> switchContextListener, org.apache.flink.metrics.MetricGroup metricGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <IN,OUT>
org.apache.flink.core.asyncprocessing.InternalAsyncFuture<OUT>handleRequest(org.apache.flink.api.common.state.v2.State state, StateRequestType type, boolean sync, IN payload, boolean allowOverdraft)
Submit aStateRequest
to this AsyncExecutionController and trigger it if needed.<IN,OUT>
org.apache.flink.core.asyncprocessing.InternalAsyncFuture<OUT>handleRequest(org.apache.flink.api.common.state.v2.State state, StateRequestType type, IN payload)
Submit aStateRequest
to this AsyncExecutionController and trigger it if needed.<IN,OUT>
OUThandleRequestSync(org.apache.flink.api.common.state.v2.State state, StateRequestType type, IN payload)
Submit aStateRequest
to this StateRequestHandler, and wait for the response synchronously.<N> void
setCurrentNamespaceForState(InternalPartitionedState<N> state, N namespace)
Set current namespace for a state.-
Methods inherited from class org.apache.flink.runtime.asyncprocessing.AsyncExecutionController
buildContext, buildContext, close, drainInflightRecords, getAsyncExecutor, getCurrentContext, getInFlightRecordNum, getMailboxExecutor, handleRequest, processNonRecord, setCurrentContext, syncPointRequestWithCallback, triggerIfNeeded, waitUntil
-
-
-
-
Constructor Detail
-
StateExecutionController
public StateExecutionController(org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor, org.apache.flink.core.asyncprocessing.AsyncFutureImpl.AsyncFrameworkExceptionHandler exceptionHandler, AsyncExecutor<StateRequest<?,?,?,?>> stateExecutor, DeclarationManager declarationManager, EpochManager.ParallelMode epochParallelMode, int maxParallelism, int batchSize, long bufferTimeout, int maxInFlightRecords, @Nullable AsyncExecutionController.SwitchContextListener<K> switchContextListener, @Nullable org.apache.flink.metrics.MetricGroup metricGroup)
-
-
Method Detail
-
handleRequest
public <IN,OUT> org.apache.flink.core.asyncprocessing.InternalAsyncFuture<OUT> handleRequest(@Nullable org.apache.flink.api.common.state.v2.State state, StateRequestType type, @Nullable IN payload)
Submit aStateRequest
to this AsyncExecutionController and trigger it if needed.- Specified by:
handleRequest
in interfaceStateRequestHandler
- Parameters:
state
- the state to request.type
- the type of this request.payload
- the payload input for this request.- Returns:
- the state future.
-
handleRequest
public <IN,OUT> org.apache.flink.core.asyncprocessing.InternalAsyncFuture<OUT> handleRequest(@Nullable org.apache.flink.api.common.state.v2.State state, StateRequestType type, boolean sync, @Nullable IN payload, boolean allowOverdraft)
Submit aStateRequest
to this AsyncExecutionController and trigger it if needed.- Parameters:
state
- the state to request.type
- the type of this request.sync
- whether to trigger the request synchronously once it's ready.payload
- the payload input for this request.allowOverdraft
- whether to allow overdraft.- Returns:
- the state future.
-
handleRequestSync
public <IN,OUT> OUT handleRequestSync(org.apache.flink.api.common.state.v2.State state, StateRequestType type, @Nullable IN payload)
Description copied from interface:StateRequestHandler
Submit aStateRequest
to this StateRequestHandler, and wait for the response synchronously.- Specified by:
handleRequestSync
in interfaceStateRequestHandler
- Parameters:
state
- the state to request.type
- the type of this request.payload
- the payload input for this request.- Returns:
- the state future.
-
setCurrentNamespaceForState
public <N> void setCurrentNamespaceForState(@Nonnull InternalPartitionedState<N> state, N namespace)
Description copied from interface:StateRequestHandler
Set current namespace for a state. SeeInternalPartitionedState.setCurrentNamespace(Object)
.- Specified by:
setCurrentNamespaceForState
in interfaceStateRequestHandler
-
-