private Optional<MajorCompactionRequest> createRequest(Connection connection, TableDescriptor htd)
    throws IOException {
    Map<String, Long> familiesToCompact = getStoresRequiringCompaction(htd);
    MajorCompactionRequest request = null;
    if (!familiesToCompact.isEmpty()) {
      LOG.debug("Compaction families for region: " + region + " CF: " + familiesToCompact.keySet());
      request = new MajorCompactionTTLRequest(connection, region);
    }
    return Optional.ofNullable(request);
  }
This request helps determine if a region has to be compacted based on table's TTL.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/compaction/MajorCompactionTTLRequest.java