Skip to content

Conversation

@accelerated
Copy link
Contributor

No description provided.

@mfontanini
Copy link
Owner

I'm not really a fan of having setters for everything. In which context do you not know the partition during construction? The (topic, partition) is basically an identifier for the object, that probably shouldn't be changing.

@accelerated
Copy link
Contributor Author

In this scenario, we have a consumer cluster reading a topic, the configuration is the same across the cluster. However each instance gets a static partition assignment either in a separate file or from db. Therefore we create the global config first, then use setters for the respective partitions and offests. So it's nice to have, otherwise you need to delay the creation of these objects.
Secondly, you have a constructor that only takes a topic. How are you supposed to set the partition in that case?

@mfontanini
Copy link
Owner

Fair enough! I guess normally I'd just keep the topic name and build the TopicPartitions when needed but I understand if you may want to avoid the string memory allocations after whatever setup phase you have.

@mfontanini mfontanini merged commit 4a3ec91 into mfontanini:master Jul 29, 2019
@accelerated
Copy link
Contributor Author

Thanks!

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