private void finalizeDelete(List<String> backupRoots, BackupSystemTable table)
    throws IOException {
    for (String backupRoot : backupRoots) {
      Set<TableName> incrTableSet = table.getIncrementalBackupTableSet(backupRoot);
      Map<TableName, List<BackupInfo>> tableMap =
        table.getBackupHistoryForTableSet(incrTableSet, backupRoot);

      // Keep only the tables that are present in other backups
      incrTableSet.retainAll(tableMap.keySet());

      table.deleteIncrementalBackupTableSet(backupRoot);
      if (!incrTableSet.isEmpty()) {
        table.addIncrementalBackupTableSet(incrTableSet, backupRoot);
      }
    }
  }
Updates incremental backup set for every backupRoot
@param backupRoots backupRoots for which to revise the incremental backup set
@param table       backup system table
@throws IOException if a table operation fails
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java