public static ShareFetchResponseData.PartitionData partitionResponse(int partition, Errors error) {
        return new ShareFetchResponseData.PartitionData()
                .setPartitionIndex(partition)
                .setErrorCode(error.code());
    }
@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