Skip to content

Conversation

@mutianf
Copy link
Contributor

@mutianf mutianf commented Mar 8, 2021

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:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 8, 2021
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/java-bigtable API. label Mar 8, 2021
@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

❗ No coverage uploaded for pull request base (dynamic_flow_control@41c948d). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                   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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41c948d...51afb97. Read the comment docs.

@mutianf mutianf force-pushed the dynamic_flow_control_p2 branch from ffd9de9 to 657c652 Compare March 10, 2021 18:13
@mutianf mutianf force-pushed the dynamic_flow_control_p2 branch from 657c652 to 7a4ff43 Compare March 10, 2021 18:45
@mutianf mutianf marked this pull request as ready for review March 10, 2021 18:46
@mutianf mutianf requested a review from a team as a code owner March 10, 2021 18:46
@mutianf mutianf requested a review from igorbernstein2 March 10, 2021 18:46
flowControlEvents.getLastFlowControlEvent() == null
? false
: (now - flowControlEvents.getLastFlowControlEvent().getTimestampMs()
<= TimeUnit.MINUTES.toMillis(5));
Copy link
Contributor

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 = ...

Comment on lines 34 to 35
private final FlowControlEventStats flowControlEvents;
private final DynamicFlowControlStats dynamicFlowControlStats;
Copy link
Contributor

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 :(

Copy link
Contributor Author

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?


UnaryCallable<MutateRowsRequest, Void> flowControlCallable = null;
if (settings.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()) {
long flowControlAdjustingIntervalMs = TimeUnit.SECONDS.toMillis(20);
Copy link
Contributor

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

Copy link
Contributor

@igorbernstein2 igorbernstein2 left a 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

@mutianf mutianf merged commit 96a74ac into googleapis:dynamic_flow_control Mar 30, 2021
@mutianf mutianf deleted the dynamic_flow_control_p2 branch March 30, 2021 14:28
mutianf added a commit to mutianf/java-bigtable that referenced this pull request Apr 10, 2021
* 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
mutianf added a commit to mutianf/java-bigtable that referenced this pull request Apr 10, 2021
* 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
mutianf added a commit to mutianf/java-bigtable that referenced this pull request Apr 10, 2021
* 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
mutianf added a commit to mutianf/java-bigtable that referenced this pull request Apr 10, 2021
* 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
mutianf added a commit to mutianf/java-bigtable that referenced this pull request Apr 12, 2021
* 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
igorbernstein2 pushed a commit that referenced this pull request Apr 13, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants