@Override
  public Iterable<FileStatus> getDeletableFiles(Iterable<FileStatus> files) {
    List<FileStatus> filteredFiles = new ArrayList<>();

    // all members of this class are null if backup is disabled,
    // so we cannot filter the files
    if (this.getConf() == null || !BackupManager.isBackupEnabled(getConf())) {
      LOG.debug("Backup is not enabled. Check your {} setting",
        BackupRestoreConstants.BACKUP_ENABLE_KEY);
      return files;
    }

    Map<Address, Long> serverToPreservationBoundaryTs;
    try {
      try (BackupManager backupManager = new BackupManager(conn, getConf())) {
        serverToPreservationBoundaryTs =
          serverToPreservationBoundaryTs(backupManager.getBackupHistory(true));
      }
    } catch (IOException ex) {
      LOG.error("Failed to analyse backup history with exception: {}. Retaining all logs",
        ex.getMessage(), ex);
      return Collections.emptyList();
    }
    for (FileStatus file : files) {
      if (canDeleteFile(serverToPreservationBoundaryTs, file.getPath())) {
        filteredFiles.add(file);
      }
    }

    LOG.info("Total files: {}, Filtered Files: {}", IterableUtils.size(files),
      filteredFiles.size());
    return filteredFiles;
  }
Calculates the timestamp boundary up to which all backup roots have already included the WAL.
I.e. WALs with a lower (= older) or equal timestamp are no longer needed for future incremental
backups.
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java