Interface StateExecutor
@Internal
public interface StateExecutor
Executor for executing batch
StateRequests.
Notice that the owner who create the StateExecutor is responsible for shutting down it
when it is no longer in use.
-
Method Summary
Modifier and TypeMethodDescriptionCreate aStateRequestContainerwhich is used to hold the batchedStateRequest.executeBatchRequests(StateRequestContainer stateRequestContainer) Execute a batch of state requests.voidexecuteRequestSync(StateRequest<?, ?, ?, ?> stateRequest) Execute a single state request *synchronously*.booleanCheck if this executor is fully loaded.voidshutdown()Shutdown the StateExecutor, and new committed state execution requests will be rejected.
-
Method Details
-
executeBatchRequests
Execute a batch of state requests.- Parameters:
stateRequestContainer- The StateRequestContainer which holds the given batch of processing requests.- Returns:
- A future can determine whether execution has completed.
-
createStateRequestContainer
StateRequestContainer createStateRequestContainer()Create aStateRequestContainerwhich is used to hold the batchedStateRequest. -
executeRequestSync
Execute a single state request *synchronously*. This is for synchronous APIs.- Parameters:
stateRequest- the request to run.
-
fullyLoaded
boolean fullyLoaded()Check if this executor is fully loaded. Will be invoked to determine whether to give more requests to run or wait for a while.- Returns:
- the count.
-
shutdown
void shutdown()Shutdown the StateExecutor, and new committed state execution requests will be rejected.
-