public interface SpeculativeExecutionPolicy extends AutoCloseable
|Modifier and Type||Method and Description|
Called when the cluster that this policy is associated with closes.
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
USECQL statement. It can be
nullif 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.
Copyright © 2017–2021. All rights reserved.