private boolean setupSaslConnection(final InputStream in2, final OutputStream out2,
    String serverPrincipal) throws IOException {
    if (this.metrics != null) {
      this.metrics.incrNsLookups();
    }
    saslRpcClient = new HBaseSaslRpcClient(this.rpcClient.conf, provider, token,
      socket.getInetAddress(), serverPrincipal, this.rpcClient.fallbackAllowed,
      this.rpcClient.conf.get("hbase.rpc.protection",
        QualityOfProtection.AUTHENTICATION.name().toLowerCase(Locale.ROOT)),
      this.rpcClient.conf.getBoolean(CRYPTO_AES_ENABLED_KEY, CRYPTO_AES_ENABLED_DEFAULT));
    return saslRpcClient.saslConnect(in2, out2);
  }
Handle connection failures If the current number of retries is equal to the max number of
retries, stop retrying and throw the exception; Otherwise backoff N seconds and try connecting
again. This Method is only called from inside setupIOstreams(), which is synchronized. Hence
the sleep is synchronized; the locks will be retained.
@param curRetries current number of retries
@param maxRetries max number of retries allowed
@param ioe        failure reason
@throws IOException if max number of retries is reached
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java