Skip to content

MINOR: TopicIdPartition improvements#11374

Merged
ijuma merged 1 commit intoapache:trunkfrom
ijuma:topic-id-partition-cleanups
Oct 5, 2021
Merged

MINOR: TopicIdPartition improvements#11374
ijuma merged 1 commit intoapache:trunkfrom
ijuma:topic-id-partition-cleanups

Conversation

@ijuma
Copy link
Copy Markdown
Member

@ijuma ijuma commented Oct 2, 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 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.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

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.
@ijuma ijuma requested a review from dajac October 2, 2021 14:04
@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Oct 2, 2021

cc @satishd who introduced this class and @jolshan who is using it in #11331

@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Oct 2, 2021

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?

@satishd
Copy link
Copy Markdown
Member

satishd commented Oct 2, 2021

@ijuma TopicIdPartition was introduced in KIP-405 but I am not sure whether KIP needs to be updated as this PR is about enhancing but not breaking or changing API that was introduced earlier.

Copy link
Copy Markdown
Member

@satishd satishd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ijuma for the PR, LGTM.

Copy link
Copy Markdown
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@ijuma ijuma merged commit 1a3e23a into apache:trunk Oct 5, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants