code: public static Integer getValidMaxRowsPerSegment(IndexTuningConfig tuningConfig)
    {
      @Nullable final Integer numShards = tuningConfig.numShards;
      @Nullable final Integer maxRowsPerSegment = tuningConfig.maxRowsPerSegment;
      if (numShards == null || numShards == -1) {
        return maxRowsPerSegment == null || maxRowsPerSegment.equals(-1)
               ? IndexTuningConfig.DEFAULT_MAX_ROWS_PER_SEGMENT
               : maxRowsPerSegment;
      } else {
        return null;
      }
    }
docs: Return the valid target partition size. If {@link IndexTuningConfig#numShards} is valid, this returns null.
  Otherwise, this returns {@link IndexTuningConfig#DEFAULT_MAX_ROWS_PER_SEGMENT} or the given
  {@link IndexTuningConfig#maxRowsPerSegment}.