-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
KAFKA-14546 - Support Partitioner fallback to default #14531
base: trunk
Are you sure you want to change the base?
Conversation
… behavior for unhandled topics.
See https://issues.apache.org/jira/browse/KAFKA-14546 for rationale. |
This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please ask a committer for review. If the PR has merge conflicts, please update it with the latest from trunk (or appropriate release branch) If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed. |
This PR is still valid and desired, has no merge conflicts and does build despite Jenkins protestations. I do not have the ability to add Reviewers. |
@@ -1368,7 +1368,7 @@ private int partition(ProducerRecord<K, V> record, byte[] serializedKey, byte[] | |||
if (record.partition() != null) | |||
return record.partition(); | |||
|
|||
if (partitioner != null) { | |||
if (partitioner != null && partitioner.partitionsTopic(record.topic())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a slight change to the behavior of the current API, could you modify the documentation?
@jimbogithub - thanks for the PR, i've got a few questions to clarify:
@jolshan - if you get time maybe you can review this? it seems like you implemented a few partitioner so you are probably the better person to speak about this... thanks! |
* @param topic The topic name | ||
*/ | ||
default boolean partitionsTopic(String topic) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it true by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea is that this would be implemented differently by different custom partitioners. As default though there is no change from current behavior.
I think this change would require a KIP since it modifies the public API. |
Allow custom Partitioners to fallback to default partitioning.