feat(spanner) : add support for client resource base routing#4548
feat(spanner) : add support for client resource base routing#4548jiren wants to merge 15 commits intogoogleapis:masterfrom
Conversation
|
@jiren Could you please fix the CI check error? After that, we can review this PR. Thanks. |
@hengfengli CI error fixed for OS X. |
There was a problem hiding this comment.
My major concern is whether we need to add ClientServiceProxy and update service.rb.
I think in client.rb::initialize, we can have the following logic:
- if resource-based routing is enabled,
- the returned endpoint is empty: use the
project.service. - the returned endpoint is same as the given one in the
project.service: use theproject.service. - the returned endpoint is different: we can create a service with the instance-specific endpoint and store it in the client instance.
- the returned endpoint is empty: use the
- If resource-based routing is not enabled, then we just use the
project.service.
In this case, we don't need to update service.rb.
google-cloud-spanner/test/google/cloud/spanner/client_service_proxy/endpont_uri_test.rb
Outdated
Show resolved
Hide resolved
|
@hengfengli I will fix the conflict once we finalize service object creation in the client, due to channel-related changes in service.rb, current resource-based routing code will not work |
5c42c3f to
521ec84
Compare
google-cloud-spanner/lib/google/cloud/spanner/resource_based_routing.rb
Outdated
Show resolved
Hide resolved
|
@jiren Why does the CI check not run for this PR again? Maybe because of the force-push. Can you try to re-trigger it? |
skuruppu
left a comment
There was a problem hiding this comment.
Looks good. Just want all the comments to be addressed before I approve.
google-cloud-spanner/test/google/cloud/spanner/client/resource_based_routing_test.rb
Outdated
Show resolved
Hide resolved
google-cloud-spanner/test/google/cloud/spanner/client/resource_based_routing_test.rb
Outdated
Show resolved
Hide resolved
google-cloud-spanner/test/google/cloud/spanner/client/resource_based_routing_test.rb
Outdated
Show resolved
Hide resolved
- add/updates docs and test
- instance get method with fields mask
- add unit test for client service proxy
521ec84 to
13eb5cd
Compare
google-cloud-spanner/lib/google/cloud/spanner/resource_based_routing.rb
Outdated
Show resolved
Hide resolved
google-cloud-spanner/test/google/cloud/spanner/client/resource_based_routing_test.rb
Outdated
Show resolved
Hide resolved
google-cloud-spanner/lib/google/cloud/spanner/resource_based_routing.rb
Outdated
Show resolved
Hide resolved
|
One more request @jiren. Please be more descriptive in the PR description. Follow googleapis/google-cloud-python#10183 as an example. |
Got it |
google-cloud-spanner/lib/google/cloud/spanner/resource_based_routing.rb
Outdated
Show resolved
Hide resolved
|
We have decided to implement this functionality on the server side so we no longer need to add this support on the client side. |
Towards #4547 issue
Implementation of Client resource based routing.
enable_resource_based_routingwhile creating a database client instance . Default client resource based routing is disabled.Implementation overview