private static Pair<Integer, Integer> calculateTabletRowCountAndMemoryBySize(
      int rowSize, int schemaCount) {
    if (rowSize <= 0) {
      return new Pair<>(1, 0);
    }

    // Calculate row number according to the max size of a pipe tablet.
    // "-100" is the estimated size of other data structures in a pipe tablet.
    // "*8" converts bytes to bits, because the bitmap size is 1 bit per schema.
    int rowNumber =
        8
            * (PipeConfig.getInstance().getPipeDataStructureTabletSizeInBytes() - 100)
            / (8 * rowSize + schemaCount);
    rowNumber = Math.max(1, rowNumber);

    if ( // This means the row number is larger than the max row count of a pipe tablet
    rowNumber > PipeConfig.getInstance().getPipeDataStructureTabletRowSize()) {
      // Bound the row number, the memory cost is rowSize * rowNumber
      return new Pair<>(
          PipeConfig.getInstance().getPipeDataStructureTabletRowSize(),
          rowSize * PipeConfig.getInstance().getPipeDataStructureTabletRowSize());
    } else {
      return new Pair<>(
          rowNumber, PipeConfig.getInstance().getPipeDataStructureTabletSizeInBytes());
    }
  }
Given a row of a tablet, calculate the row count and memory cost of the pipe tablet that will
be constructed according to config.

@return left is the row count of tablet, right is the memory cost of tablet in bytes
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryWeightUtil.java