public List<HStoreFile> selectCompactFiles(final List<HStoreFile> candidates, int maxFiles,
    boolean isOffpeak) {
    long selectedSize = 0L;
    for (int end = 0; end < Math.min(candidates.size(), maxFiles); end++) {
      selectedSize += candidates.get(end).getReader().length();
      if (selectedSize >= comConf.getMaxCompactSize(isOffpeak)) {
        return candidates.subList(0, end + 1);
      }
    }
    return candidates;
  }
Select at least one file in the candidates list to compact, through choosing files from the
head to the index that the accumulation length larger the max compaction size. This method is a
supplementary of the selectSimpleCompaction() method, aims to make sure at least one file can
be selected to compact, for compactions like L0 files, which need to compact all files and as
soon as possible.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ExploringCompactionPolicy.java