@Override
  protected int deleteFiles(Iterable<FileStatus> filesToDelete) {
    List<CleanerContext> results = new ArrayList<>();
    for (FileStatus file : filesToDelete) {
      LOG.trace("Scheduling file {} for deletion", file);
      if (file != null) {
        results.add(new CleanerContext(file));
      }
    }
    if (results.isEmpty()) {
      return 0;
    }

    LOG.debug("Old WALs for delete: {}",
      results.stream().map(cc -> cc.target.getPath().getName()).collect(Collectors.joining(", ")));
    pendingDelete.addAll(results);

    int deletedFiles = 0;
    for (CleanerContext res : results) {
      LOG.trace("Awaiting the results for deletion of old WAL file: {}", res);
      deletedFiles += res.getResult(this.cleanerThreadTimeoutMsec) ? 1 : 0;
    }
    return deletedFiles;
  }
@param period    the period of time to sleep between each run
@param stopper   the stopper
@param conf      configuration to use
@param fs        handle to the FS
@param oldLogDir the path to the archived logs
@param pool      the thread pool used to scan directories
hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/LogCleaner.java