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

create round-robin partitioner starting from a random partition #1608

Closed
wants to merge 1 commit into from
Closed

create round-robin partitioner starting from a random partition #1608

wants to merge 1 commit into from

Conversation

MrTomerLevi
Copy link

@MrTomerLevi MrTomerLevi commented Oct 23, 2018

This partitioner is useful while using multiple producers that produce limited amount of records.

Instead of using RoundRobinPartitioner which always starts from the first partition (causing unbalanced partitions) this one will pick a random partition to start from.


This change is Reviewable

Copy link
Collaborator

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

I'm pretty hesitant to take this as the RoundRobinPartitioner is a leftover from the SimpleProducer days... in fact I'm planning on removing it in #1196.

If you use the new KafkaProducer, then the default partitioner it ships with will use a random partition by default if the key is not provided... would that achieve what you're looking for? It's not technically the same as starting from a random seed and then round-robin'ing, but it's probably close enough for most use cases.

Also, in general we try to follow the Java clients, so this would be better to submit upstream as a KIP and see what the broader community thinks of it. If they choose to pull it in, then happy to take it here as well.

Marking as needing changes until we get this resolved...

@jeffwidman
Copy link
Collaborator

Sorry, but going to reject based on the above comment....

We love PRs, but you'll want to do them against the new Kafka* interfaces.

@jeffwidman jeffwidman closed this Oct 31, 2018
@MrTomerLevi
Copy link
Author

MrTomerLevi commented Oct 31, 2018 via email

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.

2 participants