protected void moveData(FileSystem fs, String backupRoot, Path bulkOutputPath,
    TableName tableName, String mergedBackupId) throws IllegalArgumentException, IOException {
    Path dest =
      new Path(HBackupFileSystem.getTableBackupDir(backupRoot, mergedBackupId, tableName));

    FileStatus[] fsts = fs.listStatus(bulkOutputPath);
    for (FileStatus fst : fsts) {
      if (fst.isDirectory()) {
        String family = fst.getPath().getName();
        Path newDst = new Path(dest, family);
        if (fs.exists(newDst)) {
          if (!fs.delete(newDst, true)) {
            throw new IOException("failed to delete :" + newDst);
          }
        } else {
          fs.mkdirs(dest);
        }
        boolean result = fs.rename(fst.getPath(), dest);
        LOG.debug("MoveData from " + fst.getPath() + " to " + dest + " result=" + result);
      }
    }
  }
Converts path before copying
@param p             path
@param backupDirPath backup root
@return converted path
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java