public interface SpeculativeExecutionPolicy extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Called when the cluster that this policy is associated with closes.
|
long |
nextExecution(Node node,
CqlIdentifier keyspace,
Request request,
int runningExecutions) |
long nextExecution(@NonNull
Node node,
@Nullable
CqlIdentifier keyspace,
@NonNull
Request request,
int runningExecutions)
node - the node that caused the speculative execution (that is, the node that was queried
previously but was too slow to answer)keyspace - the CQL keyspace currently associated to the session. This is set either
through the configuration, by calling SessionBuilder.withKeyspace(CqlIdentifier),
or by manually executing a USE CQL statement. It can be null if the session
has no keyspace.request - the request to execute.runningExecutions - the number of executions that are already running (including the
initial, non-speculative request). For example, if this is 2 it means the initial attempt
was sent, then the driver scheduled a first speculative execution, and it is now asking for
the delay until the second speculative execution.void close()
close in interface AutoCloseableCopyright © 2017–2025. All rights reserved.