public HttpResponse executePathOnly(Cluster cluster, HttpUriRequest method, Header[] headers,
    String path) throws IOException {
    IOException lastException;
    if (cluster.nodes.size() < 1) {
      throw new IOException("Cluster is empty");
    }
    if (lastNodeId == null || !sticky) {
      lastNodeId = ThreadLocalRandom.current().nextInt(cluster.nodes.size());
    }
    int start = lastNodeId;
    do {
      cluster.lastHost = cluster.nodes.get(lastNodeId);
      try {
        StringBuilder sb = new StringBuilder();
        if (sslEnabled) {
          sb.append("https://");
        } else {
          sb.append("http://");
        }
        sb.append(cluster.lastHost);
        sb.append(path);
        URI uri = new URI(sb.toString());
        if (method instanceof HttpPut) {
          HttpPut put = new HttpPut(uri);
          put.setEntity(((HttpPut) method).getEntity());
          put.setHeaders(method.getAllHeaders());
          method = put;
        } else if (method instanceof HttpGet) {
          method = new HttpGet(uri);
        } else if (method instanceof HttpHead) {
          method = new HttpHead(uri);
        } else if (method instanceof HttpDelete) {
          method = new HttpDelete(uri);
        } else if (method instanceof HttpPost) {
          HttpPost post = new HttpPost(uri);
          post.setEntity(((HttpPost) method).getEntity());
          post.setHeaders(method.getAllHeaders());
          method = post;
        }
        return executeURI(method, headers, uri.toString());
      } catch (IOException e) {
        lastException = e;
      } catch (URISyntaxException use) {
        lastException = new IOException(use);
      }
      if (!sticky) {
        lastNodeId = (++lastNodeId) % cluster.nodes.size();
      }
      // Do not retry if sticky. Let the caller handle the error.
    } while (!sticky && lastNodeId != start);
    throw lastException;
  }
Execute a transaction method given only the path. If sticky is false: Will select at random one
of the members of the supplied cluster definition and iterate through the list until a
transaction can be successfully completed. The definition of success here is a complete HTTP
transaction, irrespective of result code. If sticky is true: For the first request it will
select a random one of the members of the supplied cluster definition. For subsequent requests
it will use the same member, and it will not automatically re-try if the call fails.
@param cluster the cluster definition
@param method  the transaction method
@param headers HTTP header values to send
@param path    the properly urlencoded path
@return the HTTP response code
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/Client.java