private void doBulkLoad(Configuration conf, TableName tableName, Path stagingDir,
    Deque<LoadQueueItem> queue, int maxRetries) throws IOException {
    BulkLoadHFilesTool loader = new BulkLoadHFilesTool(conf);
    // Set the staging directory which will be used by BulkLoadHFilesTool for loading the data
    loader.setBulkToken(stagingDir.toString());
    // updating list of cluster ids where this bulkload event has already been processed
    loader.setClusterIds(sourceClusterIds);
    for (int count = 0; !queue.isEmpty(); count++) {
      if (count != 0) {
        LOG.warn("Error replicating HFiles; retry={} with {} remaining.", count, queue.size());
      }

      if (maxRetries != 0 && count >= maxRetries) {
        throw new IOException("Retry attempted " + count + " times without completing, bailing.");
      }

      // Try bulk load
      loader.loadHFileQueue(connection, tableName, queue, false);
    }
  }
Number of hfiles to copy per thread during replication
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java