KAFKA-12338: Remove useless MetadataParser#10793
Conversation
|
@dengziming Thanks for the patch. Looks like the parser has some additional validations which are not present in |
|
@hachikuji Thanks for the remindings, I think the validations in |
0eef960 to
a51b2bc
Compare
| try { | ||
| frameVersion = unsignedIntToShort(input.readUnsignedVarint(), "frame version"); | ||
| } catch (Exception e) { | ||
| throw new MetadataParseException("Failed to read variable-length " + |
There was a problem hiding this comment.
It looks like MetadataParseException is already the only thing which can be raised by unsignedIntToShort. Is it necessary to catch it and raise a new instance?
There was a problem hiding this comment.
In fact input.readUnsignedVarint() may throw a IlleagelArgumentException if it fails to read a short, this can be seen in MetadataRecordSerdeTest.testParsingMalformedFrameVersionVarint.
hachikuji
left a comment
There was a problem hiding this comment.
Thanks for the updates. Just a few more small comments.
|
@hachikuji I update the code according to your suggestions and also make the test more accurate, please take a look again. |
hachikuji
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the patch!
More detailed description of your change
MetadataParseris a duplication ofMetadataRecordSerdeand it's not used in any code, so we can remove it.Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.
QA