Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][broker] Improve the extensibility of the TopicBundleAssignmentStrategy interface class (#23773) #23774

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rayluoluo
Copy link
Contributor

@rayluoluo rayluoluo commented Dec 24, 2024

[improve][broker] Improve the extensibility of the TopicBundleAssignmentStrategy interface class (#23773)

Fixes #23773

PIP: #19806

Motivation

For details, see the description of issue #23773

Modifications

The implementation of the NamespaceBundleFactory#getLongHashCode method is moved to the implementation class of the interface TopicBundleAssignmentStrategy. Therefore, a new method long getHashCode(String name) is added to the TopicBundleAssignmentStrategy interface class. The implementation of the hash algorithm is no longer fixed in the NamespaceBundleFactory#getLongHashCode method. Instead, the getHashCode method implemented by different algorithms is invoked.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as TopicBundleAssignmentStrategyTest#testStrategyFactory, and added tests and can be verified as follows:

TopicBundleAssignmentStrategyTest

  • TopicBundleAssignmentStrategyTest#testRoundRobinBundleAssigner:A new partition assignment strategy algorithm RoundRobinBundleAssigner is customized and the TopicBundleAssignmentStrategy interface is implemented. Only the interfaces in TopicBundleAssignmentStrategy need to be implemented. It's not needed to modify the interface implementation of other classes. The open and closed principles are met.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[improve][broker] Improve the extensibility of the TopicBundleAssignmentStrategy interface class
1 participant