Package org.apache.bookkeeper.client
Interface SpeculativeRequestExecutionPolicy
- All Known Implementing Classes:
DefaultSpeculativeRequestExecutionPolicy
public interface SpeculativeRequestExecutionPolicy
Define a policy for speculative request execution.
The implementation can define its execution policy. For example, when to issue speculative requests and how many speculative requests to issue.
- Since:
- 4.5
-
Method Summary
Modifier and TypeMethodDescriptioninitiateSpeculativeRequest(ScheduledExecutorService scheduler, SpeculativeRequestExecutor requestExecutor) Initialize the speculative request execution policy and initiate requests.
-
Method Details
-
initiateSpeculativeRequest
ScheduledFuture<?> initiateSpeculativeRequest(ScheduledExecutorService scheduler, SpeculativeRequestExecutor requestExecutor) Initialize the speculative request execution policy and initiate requests.- Parameters:
scheduler- The scheduler service to issue the speculative requestrequestExecutor- The executor is used to issue the actual speculative requests- Returns:
- ScheduledFuture, in case caller needs to cancel it.
-