public void setSticky(boolean sticky) {
    lastNodeId = null;
    if (sticky) {
      stickyContext = new HttpClientContext();
      if (provider != null) {
        stickyContext.setCredentialsProvider(provider);
      }
    } else {
      stickyContext = null;
    }
    this.sticky = sticky;
  }
The default behaviour is load balancing by sending each request to a random host. This DOES NOT
work with scans, which have state on the REST servers. Set sticky to true before attempting
Scan related operations if more than one host is defined in the cluster. Nodes must not be
added or removed from the Cluster object while sticky is true. Setting the sticky flag also
enables session handling, which eliminates the need to re-authenticate each request, and lets
the client handle any other cookies (like the sticky cookie set by load balancers) correctly.
@param sticky whether subsequent requests will use the same host
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/Client.java