protected void deleteBackupImages(List<String> backupIds, Connection conn, FileSystem fs,
    String backupRoot) throws IOException {
    // Delete from backup system table
    try (BackupSystemTable table = new BackupSystemTable(conn)) {
      for (String backupId : backupIds) {
        LOG.info("Removing metadata for backup {}", backupId);
        table.deleteBackupInfo(backupId);
      }
    }

    // Delete from file system
    for (String backupId : backupIds) {
      LOG.info("Purging backup {} from FileSystem", backupId);
      Path backupDirPath = HBackupFileSystem.getBackupPath(backupRoot, backupId);

      if (!fs.delete(backupDirPath, true)) {
        LOG.warn("Could not delete " + backupDirPath);
      }
    }
  }
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