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

impl(bigtable): MutateRowsLimiter can do async #13192

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

dbolduc
Copy link
Member

@dbolduc dbolduc commented Nov 28, 2023

Part of the work for #12959

I considered having the ThrottlingMutateRowLimiter hold a CompletionQueue and Options const&, but I think it is nicer to just pass the async sleeper (std::function<future<void>(duration)>) in.


I considered only having an async sleeper, and implementing the following:

void ThrottlingMutateRowsLimiter::Acquire() {
  AsyncAcquire().get();
}

I do not want to do this, because in practice the async sleeper will be implemented by a CompletionQueue. I do not want to involve a CompletionQueue in the synchronous code paths.

A follow up PR will add a CompletionQueue as a parameter to the factory function.


Take this opportunity to reorder MakeMutateRowsLimiter() to return early from the simpler branch.


This change is Reviewable

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Nov 28, 2023
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (4dbcd15) 93.00% compared to head (cde8bef) 92.99%.

Files Patch % Lines
...loud/bigtable/internal/mutate_rows_limiter_test.cc 76.47% 8 Missing ⚠️
...gle/cloud/bigtable/internal/mutate_rows_limiter.cc 94.11% 1 Missing ⚠️
...ogle/cloud/bigtable/internal/mutate_rows_limiter.h 50.00% 1 Missing ⚠️
.../cloud/bigtable/testing/mock_mutate_rows_limiter.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13192      +/-   ##
==========================================
- Coverage   93.00%   92.99%   -0.01%     
==========================================
  Files        2138     2138              
  Lines      185991   186024      +33     
==========================================
+ Hits       172978   172999      +21     
- Misses      13013    13025      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbolduc dbolduc marked this pull request as ready for review November 28, 2023 07:54
@dbolduc dbolduc requested a review from a team as a code owner November 28, 2023 07:54
@dbolduc dbolduc merged commit 5d120b6 into googleapis:main Nov 28, 2023
59 checks passed
@dbolduc dbolduc deleted the bigtable-async-rate-limiting-pr-1 branch November 28, 2023 21:05
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 Bigtable API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants