@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "FL_FLOATS_AS_LOOP_COUNTERS",
      justification = "valid usage")
  private Pair<Long, Integer> estimateTargetKvs(Collection<HStoreFile> files, double splitCount) {
    // If the size is larger than what we target, we don't want to split into proportionally
    // larger parts and then have to split again very soon. So, we will increase the multiplier
    // by one until we get small enough parts. E.g. 5Gb stripe that should have been split into
    // 2 parts when it was 3Gb will be split into 3x1.67Gb parts, rather than 2x2.5Gb parts.
    long totalSize = getTotalFileSize(files);
    long targetPartSize = config.getSplitPartSize();
    assert targetPartSize > 0 && splitCount > 0;
    double ratio = totalSize / (splitCount * targetPartSize); // ratio of real to desired size
    while (ratio > 1.0) {
      // Ratio of real to desired size if we increase the multiplier.
      double newRatio = totalSize / ((splitCount + 1.0) * targetPartSize);
      if ((1.0 / newRatio) >= ratio) {
        // New ratio is < 1.0, but further than the last one.
        break;
      }
      ratio = newRatio;
      splitCount += 1.0;
    }
    long kvCount = (long) (getTotalKvCount(files) / splitCount);
    return new Pair<>(kvCount, (int) Math.ceil(splitCount));
  }
Selects the compaction of a single stripe using default policy.
@param sfs          Files.
@param allFilesOnly Whether a compaction of all-or-none files is needed.
@return The resulting selection.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java