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

Break consumer operations into request / response methods #1845

Merged

Conversation

jeffwidman
Copy link
Collaborator

@jeffwidman jeffwidman commented Jun 19, 2019

This breaks some of the consumer operations into request generation /
response parsing methods.

The public API does not change. However, this allows power users who are
willing to deal with risk of private methods changing under their feet
to decouple generating the message futures from processing their
responses. In other words, you can use these to fire a bunch of requests
at once and delay processing the responses until all requests are fired.


This change is Reviewable

@jeffwidman jeffwidman requested review from dpkp and tvoinarovskyi June 19, 2019 20:24
@jeffwidman
Copy link
Collaborator Author

jeffwidman commented Jun 19, 2019

Thanks to @Lou-Cipher for his excellent work in #1807 that enabled this.

At some point this idea of decoupling message generation from response parsing could be further extended to _find_group_coordinator_id() and some of the other methods, but I thought this PR was already big enough... plus I personally need the ones in this PR, but not the others yet...

@jeffwidman jeffwidman force-pushed the break-consumer-operations-into-request-response-methods branch from 8f74c40 to 3391607 Compare June 19, 2019 21:11
This breaks some of the consumer operations into request generation /
response parsing methods.

The public API does not change. However, this allows power users who are
willing to deal with risk of private methods changing under their feet
to decouple generating the message futures from processing their
responses. In other words, you can use these to fire a bunch of request
at once and delay processing the responses until all requests are fired.
@jeffwidman jeffwidman force-pushed the break-consumer-operations-into-request-response-methods branch from 3391607 to 6ec074b Compare June 19, 2019 21:31
@jeffwidman jeffwidman merged commit 01053da into master Jun 20, 2019
@jeffwidman jeffwidman deleted the break-consumer-operations-into-request-response-methods branch June 20, 2019 01:17
@jeffwidman
Copy link
Collaborator Author

jeffwidman commented Jun 20, 2019

Using this as part of a callback-based-approach to fetching all consumer offsets from a cluster of 9 brokers with several hundred consumer groups dropped collection time from ~242 seconds down to ~2 seconds. However, further testing revealed most of the gain was from #1823... details in #1823 (comment).

jeffwidman added a commit that referenced this pull request Jul 31, 2019
This splits the FindGroupCoordinator function (which is blocking) into
request generation / response parsing methods.

The public API does not change. However, this allows power users who are
willing to deal with risk of private methods changing under their feet
to decouple generating the message futures from processing their
responses. In other words, you can use these to fire a bunch of requests
at once and delay processing the responses until all requests are fired.

This is modeled on the work done in #1845.

Additionally, I removed the code that tried to leverage the error
checking from `cluster.add_group_coordinator()`. That code had changed
in #1822, removing most of the error checking... so it no longer adds
any value, but instead merely increases complexity and coupling.
jeffwidman added a commit that referenced this pull request Jul 31, 2019
This splits the `_find_coordinator_id()` method (which is blocking) into
request generation / response parsing methods.

The public API does not change. However, this allows power users who are
willing to deal with risk of private methods changing under their feet
to decouple generating the message futures from processing their
responses. In other words, you can use these to fire a bunch of requests
at once and delay processing the responses until all requests are fired.

This is modeled on the work done in #1845.

Additionally, I removed the code that tried to leverage the error
checking from `cluster.add_group_coordinator()`. That code had changed
in #1822, removing most of the error checking... so it no longer adds
any value, but instead merely increases complexity and coupling.
jeffwidman added a commit that referenced this pull request Jul 31, 2019
This splits the `_find_coordinator_id()` method (which is blocking) into
request generation / response parsing methods.

The public API does not change. However, this allows power users who are
willing to deal with risk of private methods changing under their feet
to decouple generating the message futures from processing their
responses. In other words, you can use these to fire a bunch of requests
at once and delay processing the responses until all requests are fired.

This is modeled on the work done in #1845.

Additionally, I removed the code that tried to leverage the error
checking from `cluster.add_group_coordinator()`. That code had changed
in #1822, removing most of the error checking... so it no longer adds
any value, but instead merely increases complexity and coupling.
jeffwidman added a commit that referenced this pull request Jul 31, 2019
This splits the `_find_coordinator_id()` method (which is blocking) into
request generation / response parsing methods.

The public API does not change. However, this allows power users who are
willing to deal with risk of private methods changing under their feet
to decouple generating the message futures from processing their
responses. In other words, you can use these to fire a bunch of requests
at once and delay processing the responses until all requests are fired.

This is modeled on the work done in #1845.

Additionally, I removed the code that tried to leverage the error
checking from `cluster.add_group_coordinator()`. That code had changed
in #1822, removing most of the error checking... so it no longer adds
any value, but instead merely increases complexity and coupling.
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.

1 participant