[
https://issues.apache.org/jira/browse/KAFKA-12338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jason Gustafson resolved KAFKA-12338.
-------------------------------------
Resolution: Fixed
> The code of MetadataRecordSerde duplicate with MetadataParser
> -------------------------------------------------------------
>
> Key: KAFKA-12338
> URL: https://issues.apache.org/jira/browse/KAFKA-12338
> Project: Kafka
> Issue Type: Improvement
> Reporter: dengziming
> Assignee: dengziming
> Priority: Major
>
> For example:
> MetadataRecordSerde.recordSize
> ```
> size += ByteUtils.sizeOfUnsignedVarint(data.message().apiKey());
> size += ByteUtils.sizeOfUnsignedVarint(data.version());
> size += data.message().size(serializationCache, data.version());
> ```
>
> MetadataParser.size
> ```
> long messageSize = message.size(cache, version);
> long totalSize = messageSize +
> ByteUtils.sizeOfUnsignedVarint(message.apiKey()) +
> ByteUtils.sizeOfUnsignedVarint(version);
> ```
> we can see that the logic is duplicated except that `MetadataRecordSerde` has
> an extra `DEFAULT_FRAME_VERSION`, if we want to change the serde format of
> metadata, we should modify 2 classes, this is unreasonable.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)