private AsyncClusterConnection getConnection() throws IOException {
    // See https://en.wikipedia.org/wiki/Double-checked_locking
    AsyncClusterConnection connection = sharedConn;
    if (connection == null) {
      synchronized (sharedConnLock) {
        connection = sharedConn;
        if (connection == null) {
          connection = ClusterConnectionFactory.createAsyncClusterConnection(conf, null,
            UserProvider.instantiate(conf).getCurrent());
          sharedConn = connection;
        }
      }
    }
    return connection;
  }
Do the changes and handle the pool
@param tableName             table to insert into
@param allRows               list of actions
@param batchRowSizeThreshold rowSize threshold for batch mutation
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java