@Override
  public boolean isFileDeletable(FileStatus status) {
    // Files are validated for the second time here,
    // if it causes a bottleneck this logic needs refactored
    if (!valiateFilename(status.getPath())) {
      return true;
    }
    long currentTime = EnvironmentEdgeManager.currentTime();
    long time = status.getModificationTime();
    long life = currentTime - time;

    if (LOG.isTraceEnabled()) {
      LOG.trace("File life:{}ms, ttl:{}ms, current:{}, from{}", life, ttlMs,
        FORMATTER.format(Instant.ofEpochMilli(currentTime)),
        FORMATTER.format(Instant.ofEpochMilli(time)));
    }
    if (life < 0) {
      LOG.warn("Found a file ({}) newer than current time ({} < {}), probably a clock skew",
        status.getPath(), FORMATTER.format(Instant.ofEpochMilli(currentTime)),
        FORMATTER.format(Instant.ofEpochMilli(time)));
      return false;
    }
    return life > ttlMs;
  }
Base class for time to live file cleaner.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/BaseTimeToLiveFileCleaner.java