impl(bigtable): update stub_factory and connection creation functions for dynamic pool#16052
Conversation
… for dynamic pool
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Bigtable client library by introducing support for dynamic channel pooling and instance affinity. This allows the client to maintain separate, optimized connections for different Bigtable instances, potentially improving performance and resource utilization by priming connections and using a more intelligent channel selection strategy (random two least used) when instance affinity is enabled. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for a dynamic channel pool with instance affinity, a significant enhancement for managing Bigtable connections. The changes are well-structured, introducing a new experimental option InstanceChannelAffinityOption to control the feature. The implementation correctly branches based on this option in MakeDataConnection, preserving the existing behavior for users who do not opt-in. The introduction of StubManager provides a clean abstraction for managing stubs, whether it's a single shared stub or multiple affinity-based stubs. The new BigtableRandomTwoLeastUsed decorator and DynamicChannelPool implement the core logic for the new connection management strategy. The code is well-refactored, for example, by extracting common decorator logic into ApplyCommonDecorators, which improves maintainability. The changes are also accompanied by thorough tests, covering both the new logic and ensuring existing functionality is not broken. Overall, this is a high-quality contribution that thoughtfully adds a powerful new feature.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16052 +/- ##
========================================
Coverage 92.68% 92.69%
========================================
Files 2342 2342
Lines 216379 216537 +158
========================================
+ Hits 200554 200709 +155
- Misses 15825 15828 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
diegomarquezp
left a comment
There was a problem hiding this comment.
LGTM overall, just a minor comment
Pull request was closed
Adds new functions and branch to create stubs using the DynamicChannelPool.