Skip to content

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
Contributor

@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
Contributor

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