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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.ScheduledFuture<?>
initiateSpeculativeRequest(java.util.concurrent.ScheduledExecutorService scheduler, SpeculativeRequestExecutor requestExecutor)
Initialize the speculative request execution policy and initiate requests.
-
-
-
Method Detail
-
initiateSpeculativeRequest
java.util.concurrent.ScheduledFuture<?> initiateSpeculativeRequest(java.util.concurrent.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.
-
-