private T getConnection(ConnectionId remoteId) throws IOException {
    if (failedServers.isFailedServer(remoteId.getAddress())) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Not trying to connect to " + remoteId.getAddress()
          + " this server is in the failed servers list");
      }
      throw new FailedServerException(
        "This server is in the failed servers list: " + remoteId.getAddress());
    }
    T conn;
    synchronized (connections) {
      if (!running) {
        throw new StoppedRpcClientException();
      }
      conn = connections.getOrCreate(remoteId, () -> createConnection(remoteId));
      conn.setLastTouched(EnvironmentEdgeManager.currentTime());
    }
    return conn;
  }
Get a connection from the pool, or create a new one and add it to the pool. Connections to a
given host/port are reused.
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java