|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 PercentileSpeculativeExecutionPolicy(PercentileTracker percentileTracker, double percentile, int maxSpeculativeExecutions)
percentileTracker- the component that will record latencies. It will get
registeredwith the cluster when this policy initializes.
percentile- the percentile that a request's latency must fall into to be considered slow (ex:
maxSpeculativeExecutions- the maximum number of speculative executions that will be triggered for a given request (this does not include the initial, normal request). Must be strictly positive.
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)
Copyright © 2012–2019. All rights reserved.