@Override
  public int getHealthScore() {
    long dataFilesSize = getFragmentFileSize() + getSegmentFileSize();
    long dataFiles = getFragmentFileCount() + getSegmentFileCount();
    long dataRecords = getFragmentFileRecords() + getSegmentFileRecords();

    double averageDataFileSize = getNormalizedRatio(dataFilesSize, dataFiles);
    double eqDeleteRatio = getNormalizedRatio(equalityDeleteFileRecords, dataRecords);
    double posDeleteRatio = getNormalizedRatio(posDeleteFileRecords, dataRecords);

    double tablePenaltyFactor = getTablePenaltyFactor(dataFiles, dataFilesSize);
    return (int)
        Math.ceil(
            100
                - tablePenaltyFactor
                    * (40 * getSmallFilePenaltyFactor(averageDataFileSize)
                        + 40 * getEqDeletePenaltyFactor(eqDeleteRatio)
                        + 20 * getPosDeletePenaltyFactor(posDeleteRatio)));
  }
Segment files has enough content.

<p>1. The total size of all undersized segment files is greater than target size

<p>2. There are two undersized segment file that can be merged into one
amoro-format-iceberg/src/main/java/org/apache/amoro/optimizing/plan/CommonPartitionEvaluator.java