private void cleanup(Path stagingDir) {
    // Release the file system delegation token
    fsDelegationToken.releaseDelegationToken();
    // Delete the staging directory
    if (stagingDir != null) {
      try {
        sinkFs.delete(stagingDir, true);
      } catch (IOException e) {
        LOG.warn("Failed to delete the staging directory " + stagingDir, e);
      }
    }
    // Do not close the file system
  }
Number of hfiles to copy per thread during replication
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java