@Override
  public CompactionRequestImpl selectCompaction(Collection<HStoreFile> candidateFiles,
    List<HStoreFile> filesCompacting, boolean isUserCompaction, boolean mayUseOffPeak,
    boolean forceMajor) throws IOException {
    if (forceMajor) {
      LOG.warn("Major compaction is not supported for FIFO compaction policy. Ignore the flag.");
    }
    boolean isAfterSplit = StoreUtils.hasReferences(candidateFiles);
    if (isAfterSplit) {
      LOG.info("Split detected, delegate selection to the parent policy.");
      return super.selectCompaction(candidateFiles, filesCompacting, isUserCompaction,
        mayUseOffPeak, forceMajor);
    }

    // Nothing to compact
    Collection<HStoreFile> toCompact = getExpiredStores(candidateFiles, filesCompacting);
    CompactionRequestImpl result = new CompactionRequestImpl(toCompact);
    return result;
  }
FIFO compaction policy selects only files which have all cells expired. The column family MUST
have non-default TTL. One of the use cases for this policy is when we need to store raw data
which will be post-processed later and discarded completely after quite short period of time. Raw
time-series vs. time-based roll up aggregates and compacted time-series. We collect raw
time-series and store them into CF with FIFO compaction policy, periodically we run task which
creates roll up aggregates and compacts time-series, the original raw data can be discarded after
that.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/FIFOCompactionPolicy.java