MINOR: TopicIdPartition improvements#11374
Merged
ijuma merged 1 commit intoapache:trunkfrom Oct 5, 2021
Merged
Conversation
1. It should not require a TopicPartition during construction and normal usage. 2. Simplify `equals` since `topicId` and `topicPartition` are never null. 3. Inline `Objects.hash` to avoid array allocation. 4. Make `toString` more concise using a similar approach as `TopicPartition` since this `TopicIdPartition` will replace `TopicPartition` in many places in the future. 5. Add unit tests for `TopicIdPartition`, it seems like we had none. 6. Minor clean-up in calling/called classes.
Member
Author
Member
Author
|
One more thing, this is in a public package. So we need to update the KIP where we introduced this class. @satishd which KIP was that? |
Member
|
@ijuma |
3 tasks
xdgrulez
pushed a commit
to xdgrulez/kafka
that referenced
this pull request
Dec 22, 2021
1. It should not require a TopicPartition during construction and normal usage. 2. Simplify `equals` since `topicId` and `topicPartition` are never null. 3. Inline `Objects.hash` to avoid array allocation. 4. Make `toString` more concise using a similar approach as `TopicPartition` since this `TopicIdPartition` will replace `TopicPartition` in many places in the future. 5. Add unit tests for `TopicIdPartition`, it seems like we had none. 6. Minor clean-up in calling/called classes. Reviewers: David Jacot <djacot@confluent.io>, Satish Duggana <satishd@apache.org>
kamalcph
pushed a commit
to satishd/kafka
that referenced
this pull request
Jun 17, 2022
Summary: 1. It should not require a TopicPartition during construction and normal usage. 2. Simplify `equals` since `topicId` and `topicPartition` are never null. 3. Inline `Objects.hash` to avoid array allocation. 4. Make `toString` more concise using a similar approach as `TopicPartition` since this `TopicIdPartition` will replace `TopicPartition` in many places in the future. 5. Add unit tests for `TopicIdPartition`, it seems like we had none. 6. Minor clean-up in calling/called classes. Apache-Reviewers: David Jacot <djacot@confluent.io>, Satish Duggana <satishd@apache.org> Reviewers: #ldap_kafka_admins, prateeka, satishd Reviewed By: #ldap_kafka_admins, satishd JIRA Issues: DKAFC-2150 Differential Revision: https://code.uberinternal.com/D7551487
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.
usage.
equalssincetopicIdandtopicPartitionare nevernull.
Objects.hashto avoid array allocation.toStringmore concise using a similar approach asTopicPartitionsinceTopicIdPartitionwill replaceTopicPartitionin many places in the future.TopicIdPartition, it seems like we had none.Committer Checklist (excluded from commit message)