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

feat(bigtable): add AppProfileIdOption #9382

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

dbolduc
Copy link
Member

@dbolduc dbolduc commented Jun 29, 2022

Part of the work for #9349

For now, if the AppProfileIdOption is supplied to the Table constructor, we copy the value into Table::app_profile_id_, and pass that along to the Connection when a call is made.

In a follow up PR, I will modify the Connection API to drop the app_profile_id argument from its calls, and instead look for the value in CurrentOptions(). I think I will drop Table::app_profile_id_ in that PR as well.


This change is Reviewable

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Jun 29, 2022
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 8bda02de942e50e29ca6e86a25ef46b66f66e311

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #9382 (b4ecca8) into main (f589461) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #9382      +/-   ##
==========================================
- Coverage   94.67%   94.67%   -0.01%     
==========================================
  Files        1480     1480              
  Lines      135574   135579       +5     
==========================================
+ Hits       128354   128355       +1     
- Misses       7220     7224       +4     
Impacted Files Coverage Δ
google/cloud/bigtable/table.h 99.22% <100.00%> (ø)
google/cloud/bigtable/table_test.cc 100.00% <100.00%> (ø)
...e/cloud/bigtable/testing/table_integration_test.cc 80.66% <100.00%> (-0.22%) ⬇️
...ogle/cloud/bigtable/tests/data_integration_test.cc 97.72% <100.00%> (ø)
...gtable/tests/table_sample_rows_integration_test.cc 100.00% <100.00%> (ø)
...integration_tests/schema_admin_integration_test.cc 98.88% <0.00%> (-1.12%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 98.00% <0.00%> (-0.75%) ⬇️
google/cloud/internal/curl_impl.cc 91.64% <0.00%> (-0.23%) ⬇️
google/cloud/pubsub/samples/samples.cc 92.11% <0.00%> (-0.08%) ⬇️
...le/cloud/internal/default_completion_queue_impl.cc 97.72% <0.00%> (+0.56%) ⬆️
... and 1 more

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 f589461...b4ecca8. Read the comment docs.

@dbolduc dbolduc marked this pull request as ready for review June 29, 2022 17:56
@dbolduc dbolduc requested a review from a team as a code owner June 29, 2022 17:56
@@ -37,6 +37,7 @@
#include "google/cloud/status.h"
#include "google/cloud/status_or.h"
#include "absl/meta/type_traits.h"
#include "options.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/"options.h"/"google/cloud/options.h"/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh. Fixed.

@@ -51,6 +51,15 @@ namespace cloud {
namespace bigtable {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/**
* The application profile id needed for using the replication API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Option" and "needed" sound like opposites.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol. It is needed to use an optional feature. I updated the comment to avoid this confusion.

(not related to your comment, but) I also added some more information on app profiles.

@@ -37,6 +37,7 @@
#include "google/cloud/status.h"
#include "google/cloud/status_or.h"
#include "absl/meta/type_traits.h"
#include "options.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh. Fixed.

Options options = {})
: app_profile_id_(std::move(app_profile_id)),
std::string table_id, Options options = {})
: app_profile_id_(options.get<AppProfileIdOption>()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this wait until options_ is constructed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't matter. The plan is to remove app_profile_id_ in a future PR, and have options_ be the only place the value is stored. I felt this intermediate state was a decent way to break down the changes.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: b4ecca8bc6894dc86e878e83198b76c33b48e5a2

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@dbolduc dbolduc merged commit 8b167c8 into googleapis:main Jun 29, 2022
@dbolduc dbolduc deleted the bigtable-app-profile-id-option branch June 29, 2022 20:09
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.

4 participants