private boolean doesAnyColFamilyHaveTTL(TableDescriptor htd) {
    for (ColumnFamilyDescriptor descriptor : htd.getColumnFamilies()) {
      if (descriptor.getTimeToLive() != HConstants.FOREVER) {
        return true;
      }
    }
    return false;
  }
This tool compacts a table's regions that are beyond it's TTL. It helps to save disk space and
regions become empty as a result of compaction.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/compaction/MajorCompactorTTL.java