- Notifications
You must be signed in to change notification settings - Fork 102
feat: Dynamic flow control p2 #670
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 p2 #670
Conversation
Codecov Report
@@ Coverage Diff @@ ## dynamic_flow_control #670 +/- ## ======================================================= Coverage ? 59.20% Complexity ? 19 ======================================================= Files ? 2 Lines ? 125 Branches ? 18 ======================================================= Hits ? 74 Misses ? 34 Partials ? 17 Continue to review full report at Codecov.
|
ffd9de9 to 657c652 Compare 657c652 to 7a4ff43 Compare ...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Show resolved Hide resolved
| flowControlEvents.getLastFlowControlEvent() == null | ||
| ? false | ||
| : (now - flowControlEvents.getLastFlowControlEvent().getTimestampMs() | ||
| <= TimeUnit.MINUTES.toMillis(5)); |
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.
Can you extract the thresholds to named constants?
ie. MIN_THROTTLE_INTERVAL = Duration.ofMinutes(5)
CONCURRENCY_DECREASE_STEP = 0.3;
CONCURRENCY_INCREASE_STEP = ...
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
| private final FlowControlEventStats flowControlEvents; | ||
| private final DynamicFlowControlStats dynamicFlowControlStats; |
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 think we can improve on class naming here. The names are too similar which makes hard to remember what each does. Unfortunately I dont have good suggestions :(
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.
Yeah, I noticed this too but also don't have any better idea 😢
But after flowControlEvents is moved to flowController I think it's less confusing now?
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Show resolved Hide resolved
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
...loud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java Outdated Show resolved Hide resolved
| | ||
| UnaryCallable<MutateRowsRequest, Void> flowControlCallable = null; | ||
| if (settings.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()) { | ||
| long flowControlAdjustingIntervalMs = TimeUnit.SECONDS.toMillis(20); |
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 should be a constant somewhere
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.
lgtm with a minor nit
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
...igtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java Outdated Show resolved Hide resolved
* 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
* 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
* 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
* 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
* 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
* 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
Part 2 of go/veneer-dynamic-flow-control.
Adding dynamic flow control callable to bulk mutation
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> ☕️