code: private void sendRequest(
        Node retriedNode,
        Queue<Node> queryPlan,
        int currentExecutionIndex,
        int retryCount,
        boolean scheduleNextExecution) {
      if (result.isDone()) {
        return;
      }
      Node node = retriedNode;
      DriverChannel channel = null;
      if (node == null || (channel = session.getChannel(node, logPrefix)) == null) {
        while (!result.isDone() && (node = queryPlan.poll()) != null) {
          channel = session.getChannel(node, logPrefix);
          if (channel != null) {
            break;
          }
        }
      }
      if (channel == null) {
        // We've reached the end of the query plan without finding any node to write to
        if (!result.isDone() && activeExecutionsCount.decrementAndGet() == 0) {
          // We're the last execution so fail the result
          setFinalError(AllNodesFailedException.fromErrors(this.errors), null, -1);
        }
      } else {
        NodeResponseCallback nodeResponseCallback =
            new NodeResponseCallback(
                node,
                queryPlan,
                channel,
                currentExecutionIndex,
                retryCount,
                scheduleNextExecution,
                logPrefix);
        channel
            .write(message, statement.isTracing(), statement.getCustomPayload(), nodeResponseCallback)
            .addListener(nodeResponseCallback);
      }
    }
docs: Sends the request to the next available node.
  
  @param retriedNode if not null, it will be attempted first before the rest of the query plan.
  @param queryPlan the list of nodes to try (shared with all other executions)
  @param currentExecutionIndex 0 for the initial execution, 1 for the first speculative one, etc.
  @param retryCount the number of times that the retry policy was invoked for this execution
  already (note that some internal retries don't go through the policy, and therefore don't
  increment this counter)
  @param scheduleNextExecution whether to schedule the next speculative execution