The policy that decides if the driver will send speculative queries to the next hosts when the current host takes too long to respond.

Note that only idempotent statements will be speculatively retried.

Abstract
This class is abstract

Constructor

new

SpeculativeExecutionPolicy

()

Methods

init

(Client client)

Initialization method that gets invoked on Client startup.

Abstract
This function is abstract
Parameters:
Name Type Description
client Client

newPlan

(String keyspace, String or Array<String> queryInfo)

Gets the plan to use for a new query. Returns an object with a nextExecution() method, which returns a positive number representing the amount of milliseconds to delay the next execution or a non-negative number to avoid further executions.

Abstract
This function is abstract
Parameters:
Name Type Description
keyspace String

The currently logged keyspace.

queryInfo String or Array<String>

The query, or queries in the case of batches, for which to build a plan.

Returns:
Type Description
Object

shutdown

()

Gets invoked at client shutdown, giving the opportunity to the implementor to perform cleanup.

Abstract
This function is abstract