public static int recordsSize(ShareFetchResponseData.PartitionData partition) {
        return partition.records() == null ? 0 : partition.records().sizeInBytes();
    }
@return The size in bytes of the records. 0 is returned if records of input partition is null.
clients/src/main/java/org/apache/kafka/common/requests/ShareFetchResponse.java