Interface StateExecutor
-
@Internal public interface StateExecutor
Executor for executing batchStateRequest
s.Notice that the owner who create the
StateExecutor
is responsible for shutting down it when it is no longer in use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StateRequestContainer
createStateRequestContainer()
Create aStateRequestContainer
which is used to hold the batchedStateRequest
.CompletableFuture<Void>
executeBatchRequests(StateRequestContainer stateRequestContainer)
Execute a batch of state requests.void
executeRequestSync(StateRequest<?,?,?,?> stateRequest)
Execute a single state request *synchronously*.boolean
fullyLoaded()
Check if this executor is fully loaded.void
shutdown()
Shutdown the StateExecutor, and new committed state execution requests will be rejected.
-
-
-
Method Detail
-
executeBatchRequests
CompletableFuture<Void> executeBatchRequests(StateRequestContainer stateRequestContainer)
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 aStateRequestContainer
which is used to hold the batchedStateRequest
.
-
executeRequestSync
void executeRequestSync(StateRequest<?,?,?,?> stateRequest)
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.
-
-