public interface SpeculativeExecutionPolicy
Note that only idempotent statements will be speculatively retried, see Statement.isIdempotent()
for more information.
Modifier and Type | Interface and Description |
---|---|
static interface |
SpeculativeExecutionPolicy.SpeculativeExecutionPlan
A plan that governs speculative executions for a given query.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Gets invoked at cluster shutdown.
|
void |
init(Cluster cluster)
Gets invoked at cluster startup.
|
SpeculativeExecutionPolicy.SpeculativeExecutionPlan |
newPlan(String loggedKeyspace,
Statement statement)
Returns the plan to use for a new query.
|
void init(Cluster cluster)
cluster
- the cluster that this policy is associated with.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 USE
query) for the session on which
this plan need to be built. This can be null
if the corresponding session has no
keyspace logged in.statement
- the query for which to build a plan.void close()
This gives the policy the opportunity to perform some cleanup, for instance stop threads that it might have started.
Copyright © 2012–2024. All rights reserved.