MINOR: Fix MetadataResponse#toStruct serialization for null leaders#4449
Merged
hachikuji merged 1 commit intoapache:trunkfrom Jan 27, 2018
Merged
Conversation
ijuma
reviewed
Jan 19, 2018
Member
There was a problem hiding this comment.
We could perhaps add a leaderId in PartitionMetadata
91aab9f to
33d067e
Compare
Contributor
|
Actually I may have jumped the gun on my +1. I was looking at uses of |
33d067e to
e730d96
Compare
Contributor
Author
|
Should be fixed now |
hachikuji
reviewed
Jan 25, 2018
Contributor
There was a problem hiding this comment.
It's a little annoying that we have to handle both null and None. Any reason not to use flatMap as suggested offline?
.flatMap(p => Option(p.leader))Or something like that.
…tly. In MetadataResponse deserialization, if the partition leader key is set to -1, the leader is set to null. The MetadataResponse#toStruct code should handle this correctly as well. Also fix a case in KafkaApis where we were not taking into account the possibility of the leader being null. RequestResponseTest should test this as well.
e730d96 to
8a278e6
Compare
hachikuji
pushed a commit
that referenced
this pull request
Jan 27, 2018
…tly. (#4449) In MetadataResponse deserialization, if the partition leader key is set to -1, the leader is set to null. The MetadataResponse#toStruct code should handle this correctly as well. Also fix a case in KafkaApis where we were not taking into account the possibility of the leader being null. RequestResponseTest should test this as well. Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In MetadataResponse deserialization, if the partition leader key is set
to -1, the leader is set to null. The MetadataResponse#toStruct code
should handle this correctly as well.
RequestResponseTest should test this as well.