public class ConstantSpeculativeExecutionPolicy extends Object implements SpeculativeExecutionPolicy
SpeculativeExecutionPolicythat schedules a given number of speculative executions, separated by a fixed delay.
|Constructor and Description|
Builds a new instance.
|Modifier and Type||Method and Description|
Gets invoked at cluster shutdown.
Gets invoked at cluster startup.
Returns the plan to use for a new query.
public ConstantSpeculativeExecutionPolicy(long constantDelayMillis, int maxSpeculativeExecutions)
constantDelayMillis- the delay between each speculative execution. Must be strictly positive.
maxSpeculativeExecutions- the number of speculative executions. Must be strictly positive.
IllegalArgumentException- if one of the arguments does not respect the preconditions above.
public SpeculativeExecutionPolicy.SpeculativeExecutionPlan newPlan(String loggedKeyspace, Statement statement)
loggedKeyspace- the currently logged keyspace (the one set through either
Cluster.connect(String)or by manually doing a
USEquery) for the session on which this plan need to be built. This can be
nullif the corresponding session has no keyspace logged in.
statement- the query for which to build a plan.
public void init(Cluster cluster)
cluster- the cluster that this policy is associated with.
public void close()