KAFKA-12260: Avoid hitting NPE for partitionsFor#10017
Merged
abbccdda merged 6 commits intoapache:trunkfrom May 26, 2021
Merged
KAFKA-12260: Avoid hitting NPE for partitionsFor#10017abbccdda merged 6 commits intoapache:trunkfrom
abbccdda merged 6 commits intoapache:trunkfrom
Conversation
chia7712
approved these changes
Feb 2, 2021
Member
chia7712
left a comment
There was a problem hiding this comment.
+1 to eliminate null from Public APIs.
one (unrelated) question is left.
Member
There was a problem hiding this comment.
just curious.
Is it possible that an existent topic has no partitions? If so, returning empty list may confuse users who querying nonexistent topic. Maybe we should throw UnknownTopicOrPartitionException for nonexistent topic and return empty list for existent topic.
Member
There was a problem hiding this comment.
BTW, it is worth writing docs for this case (return empty list).
Author
There was a problem hiding this comment.
I don't think you could have a topic with 0 partition.
d6673be to
521460e
Compare
Member
|
@abbccdda Thanks for updating code. Two minor comments are left.
|
Author
|
@chia7712 Sounds good |
ac8000e to
02e5491
Compare
02e5491 to
8054053
Compare
ijuma
added a commit
to ijuma/kafka
that referenced
this pull request
May 27, 2021
…nups * apache-github/trunk: MINOR: Adjust parameter ordering of `waitForCondition` and `retryOnExceptionWithTimeout` (apache#10759) KAFKA-12796: Removal of deprecated classes under streams-scala (apache#10710) KAFKA-12819: Add assert messages to MirrorMaker tests plus other quality of life improvements (apache#10762) Update implementation.html (apache#10771) MINOR: Log constructor: Flip logical NOT for readability (apache#10756) MINOR: deprecate TaskMetadata constructor and add KIP-740 notes to upgrade guide (apache#10755) MINOR: Log more information when producer snapshot is written (apache#10757) KAFKA-12260: Avoid hitting NPE for partitionsFor (apache#10017) MINOR: add window verification to sliding-window co-group test (apache#10745) KAFKA-12800: Configure generator to fail on trailing JSON tokens (apache#10717)
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.
As mentioned in the ticket, returning
nullforconsumer#partitionsForis not a good client side agreement. Addressing this problem by returning the empty list instead.Committer Checklist (excluded from commit message)