public static Pair<Integer, Integer> calculateTabletRowCountAndMemory(RowRecord row) {
    int totalSizeInBytes = 0;

    // timestamp
    totalSizeInBytes += 8L;

    // values
    final List<Field> fields = row.getFields();
    int schemaCount = 0;
    if (fields != null) {
      schemaCount = fields.size();
      for (final Field field : fields) {
        if (field == null) {
          continue;
        }

        final TSDataType tsDataType = field.getDataType();
        if (tsDataType == null) {
          continue;
        }

        if (tsDataType.isBinary()) {
          final Binary binary = field.getBinaryV();
          totalSizeInBytes += binary == null ? 8 : binary.ramBytesUsed();
        } else {
          totalSizeInBytes +=
              roundUpToMultiple(TsPrimitiveType.getByType(tsDataType).getSize() + 8, 8);
        }
      }
    }

    return calculateTabletRowCountAndMemoryBySize(totalSizeInBytes, schemaCount);
  }
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