protected static boolean canDeleteFile(Map<Address, Long> addressToBoundaryTs, Path path) {
    if (isHMasterWAL(path)) {
      return true;
    }

    try {
      String hostname = BackupUtils.parseHostNameFromLogFile(path);
      if (hostname == null) {
        LOG.warn(
          "Cannot parse hostname from RegionServer WAL file: {}. Ignoring cleanup of this log",
          path);
        return false;
      }
      Address walServerAddress = Address.fromString(hostname);
      long walTimestamp = AbstractFSWALProvider.getTimestamp(path.getName());

      if (!addressToBoundaryTs.containsKey(walServerAddress)) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("No cleanup WAL time-boundary found for server: {}. Ok to delete file: {}",
            walServerAddress.getHostName(), path);
        }
        return true;
      }

      Long backupBoundary = addressToBoundaryTs.get(walServerAddress);
      if (backupBoundary >= walTimestamp) {
        if (LOG.isDebugEnabled()) {
          LOG.debug(
            "WAL cleanup time-boundary found for server {}: {}. Ok to delete older file: {}",
            walServerAddress.getHostName(), backupBoundary, path);
        }
        return true;
      }

      if (LOG.isDebugEnabled()) {
        LOG.debug("WAL cleanup time-boundary found for server {}: {}. Keeping younger file: {}",
          walServerAddress.getHostName(), backupBoundary, path);
      }
    } catch (Exception ex) {
      LOG.warn("Error occurred while filtering file: {}. Ignoring cleanup of this log", path, ex);
      return false;
    }
    return false;
  }
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