-
Notifications
You must be signed in to change notification settings - Fork 102
feat: dynamic flow control part 1 #620
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
feat: dynamic flow control part 1 #620
Conversation
Codecov Report
@@ Coverage Diff @@
## dynamic_flow_control #620 +/- ##
===========================================================
- Coverage 81.71% 59.20% -22.52%
+ Complexity 1156 19 -1137
===========================================================
Files 110 2 -108
Lines 7214 125 -7089
Branches 377 18 -359
===========================================================
- Hits 5895 74 -5821
+ Misses 1119 34 -1085
+ Partials 200 17 -183 Continue to review full report at Codecov.
|
igorbernstein2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we your PRs should point to a separate branch until they are usable? I'm concerned about having to cut a release of the client with only the public surface exposed w/o any of plumbing
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
Show resolved
Hide resolved
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java
Show resolved
Hide resolved
...loud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
Outdated
Show resolved
Hide resolved
igorbernstein2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new approach of always upgrading to DynamicFlowControlSettings, but i think we need to do a bit more work on the defaults
| private BatchingCallSettings<RowMutationEntry, Void, BulkMutation, Void> batchingCallSettings; | ||
| private boolean isLatencyBasedThrottlingEnabled; | ||
| private Long targetRpcLatencyMs; | ||
| private DynamicFlowControlSettings dynamicFlowControlSettings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make these final.
Also if you dont mind, please backfill final for batchingCallSettings
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java
Outdated
Show resolved
Hide resolved
...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java
Show resolved
Hide resolved
25faa30 to
29b156b
Compare
29b156b to
ba29be1
Compare
| * Enables / disables latency based throttling. If enabling the setting, targetRpcLatency needs | ||
| * to be set. | ||
| */ | ||
| public Builder setLatencyBasedThrottling( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and everywhere else BetaApi for new public surfaces.
Also, can we split this up into enableLatencyBasedThrottling(targetMs) and disableLatencyBasedThrottling()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class already has BetaApi annotation, will we still need them for each method?
Will split up the settings.
| * Gets the {@link DynamicFlowControlSettings} that'll be used to set up a {@link | ||
| * FlowController} for throttling. | ||
| * | ||
| * <p>By default, this will allow a maximum of 1000 entries per channel of {@link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the defaults should be set/documented here. This class can be used for both reads and writes. I'm not sure that the 2 should share their defaults. Can we document this on the BigtableDataSettings or StubSettings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this class is only for BulkMutation? public final class BigtableBatchingCallSettings extends UnaryCallSettings<BulkMutation, Void> and reads use BigtableBulkReadRowsCallSettings.
I put the documentation here because: default DynamicFlowControlSettings depends on the default settings for maxElementCount and maxRequestBytes. And nowhere else is DynamicFlowControlSettings mentioned. So I thought it might be easier to put all the explanations here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming is hard :(
BigtableBatchingCallSettings sounds generic and I forgot that we created a separate class for reads
* feat: dynamic flow control p1, add settings * update documents * move flow controller instantiation to stub.create * fix test * add some tests * split out settings to BatchCallSettings * add getters for target rpc latency * fix doc * more changes in doc * update document and checks on parameters * add more docs on flow control configs * fix test * split up enable/disable settings
* feat: dynamic flow control p1, add settings * update documents * move flow controller instantiation to stub.create * fix test * add some tests * split out settings to BatchCallSettings * add getters for target rpc latency * fix doc * more changes in doc * update document and checks on parameters * add more docs on flow control configs * fix test * split up enable/disable settings
* feat: dynamic flow control p1, add settings * update documents * move flow controller instantiation to stub.create * fix test * add some tests * split out settings to BatchCallSettings * add getters for target rpc latency * fix doc * more changes in doc * update document and checks on parameters * add more docs on flow control configs * fix test * split up enable/disable settings
* feat: dynamic flow control p1, add settings * update documents * move flow controller instantiation to stub.create * fix test * add some tests * split out settings to BatchCallSettings * add getters for target rpc latency * fix doc * more changes in doc * update document and checks on parameters * add more docs on flow control configs * fix test * split up enable/disable settings
* feat: dynamic flow control p1, add settings * update documents * move flow controller instantiation to stub.create * fix test * add some tests * split out settings to BatchCallSettings * add getters for target rpc latency * fix doc * more changes in doc * update document and checks on parameters * add more docs on flow control configs * fix test * split up enable/disable settings
* feat: dynamic flow control part 1 (#620) * feat: dynamic flow control p1, add settings * update documents * move flow controller instantiation to stub.create * fix test * add some tests * split out settings to BatchCallSettings * add getters for target rpc latency * fix doc * more changes in doc * update document and checks on parameters * add more docs on flow control configs * fix test * split up enable/disable settings * feat: Dynamic flow control p2 (#670) * feat: dynamic flow control for bulk mutation batcher * improve documents * add integration test * clean up tests and formatting * add more comments * moved FlowControlEventStats into FlowController * updates based on review p1 * updates based on review p2 * updates on review * update constant * fix tests * make row key prefix random * updates based on review
Implementation of go/veneer-dynamic-flow-control.
Part 1, add the settings for enabling / disabling dynamic flow control. The settings will later be used in EnhancedBigtableStub, see #612 for reference.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️