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): configure *Clients with EndpointOption #9082

Merged
merged 2 commits into from
May 27, 2022

Conversation

dbolduc
Copy link
Member

@dbolduc dbolduc commented May 27, 2022

Fixes #9027 and does a tiny bit of the work for #9081

This change:

  1. Makes it possible to use EndpointOption with DataClient, AdminClient, and InstanceAdminClient
  2. Recommends against using DataEndpointOption, AdminEndpointOption, and InstanceAdminEndpointOption to configure the above classes in documentation only.

Note that our Default*Options() functions expect DefaultOptions() to provide input via *EndpointOption. (for example here). I will clean this stuff up as part of #9081.


This change is Reviewable

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

Google Cloud Build Logs
For commit: c4953b35ac50e548b5abb02f0df2d8c91076b0ea

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

@dbolduc dbolduc force-pushed the bigtable-uses-endpoint-option branch from c4953b3 to d973532 Compare May 27, 2022 10:54
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: d9735324be23cb5c1e78fedb84e7f08ac823c084

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

@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Merging #9082 (038f6b5) into main (7b535ee) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #9082   +/-   ##
=======================================
  Coverage   94.43%   94.43%           
=======================================
  Files        1430     1430           
  Lines      127051   127084   +33     
=======================================
+ Hits       119978   120015   +37     
+ Misses       7073     7069    -4     
Impacted Files Coverage Δ
google/cloud/bigtable/client_options.h 100.00% <ø> (ø)
google/cloud/bigtable/benchmarks/benchmark.cc 78.90% <100.00%> (-0.49%) ⬇️
.../cloud/bigtable/benchmarks/embedded_server_test.cc 100.00% <100.00%> (ø)
google/cloud/bigtable/internal/defaults.cc 100.00% <100.00%> (ø)
google/cloud/bigtable/internal/defaults_test.cc 100.00% <100.00%> (ø)
...le/cloud/internal/default_completion_queue_impl.cc 97.15% <0.00%> (-0.57%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 98.00% <0.00%> (+0.24%) ⬆️
...le/cloud/storage/internal/curl_download_request.cc 89.59% <0.00%> (+0.33%) ⬆️
...ud/spanner/integration_tests/client_stress_test.cc 86.18% <0.00%> (+0.65%) ⬆️
google/cloud/pubsub/subscriber_connection_test.cc 97.91% <0.00%> (+0.69%) ⬆️
... 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 7b535ee...038f6b5. Read the comment docs.

@dbolduc dbolduc marked this pull request as ready for review May 27, 2022 11:16
@dbolduc dbolduc requested a review from a team as a code owner May 27, 2022 11:16
@@ -79,6 +79,13 @@ int DefaultConnectionPoolSize() {
Options DefaultOptions(Options opts) {
using ::google::cloud::internal::GetEnv;

if (opts.has<EndpointOption>()) {
auto const& ep = opts.get<EndpointOption>();
opts.set<DataEndpointOption>(ep);
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the application already provided DataEndpointOption for some reason?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to me this is a breaking change. The behavior is now different.

Copy link
Member Author

Choose a reason for hiding this comment

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

The behavior is only different if you were setting both EndpointOption and *EndpointOption (to different values). That's possible, but it would be really strange. The only case I can think of is reusing one set of options for the Data API and for the generated Admin APIs.

I'll change this PR so that *EndpointOption takes precedence over EndpointOption. It feels weird because I want to do away with the *EndpointOptions. But that's ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. PTAL

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 038f6b50b90a59e090e05bc5436d93c13bcba5b1

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

@dbolduc dbolduc enabled auto-merge (squash) May 27, 2022 14:23
@dbolduc dbolduc merged commit 30c06a2 into googleapis:main May 27, 2022
@dbolduc dbolduc deleted the bigtable-uses-endpoint-option branch June 7, 2022 14:29
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.

Bigtable (legacy) *Client classes should respect EndpointOption when configured directly with Options
3 participants