Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

gax-grpc: allow custom direct path service config#1235

Merged
vam-google merged 12 commits intogoogleapis:masterfrom
dapengzhang0:allow_providing_service_config_for_direct_path_2
Dec 21, 2020
Merged

gax-grpc: allow custom direct path service config#1235
vam-google merged 12 commits intogoogleapis:masterfrom
dapengzhang0:allow_providing_service_config_for_direct_path_2

Conversation

@dapengzhang0
Copy link
Copy Markdown
Contributor

This is resubmission of #879 the original author of which has left google. We need this API for CBT client to set specific direct path service config using route-lookup load balancing policy.

This change allows gax-grpc users to specify service config for (mostly) more advanced direct path configuration. e.g. using different load balancing policy.
By default, behavior remains same as today.

This change allows gax-grpc users to specify service config for (mostly) more advanced direct path configuration. e.g. using different load balancing policy.
By default, behavior remains same as today.
@dapengzhang0 dapengzhang0 requested a review from a team November 3, 2020 18:29
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 3, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 3, 2020

Codecov Report

Merging #1235 (977e4e9) into master (ef9b3aa) will increase coverage by 0.16%.
The diff coverage is 93.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1235      +/-   ##
============================================
+ Coverage     78.98%   79.14%   +0.16%     
- Complexity     1226     1227       +1     
============================================
  Files           209      209              
  Lines          5357     5362       +5     
  Branches        446      448       +2     
============================================
+ Hits           4231     4244      +13     
+ Misses          948      939       -9     
- Partials        178      179       +1     
Impacted Files Coverage Δ Complexity Δ
...api/gax/grpc/InstantiatingGrpcChannelProvider.java 74.05% <93.33%> (+4.97%) 35.00 <1.00> (+2.00)
.../java/com/google/api/gax/batching/BatcherImpl.java 96.12% <0.00%> (-0.65%) 15.00% <0.00%> (-1.00%)

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 ef9b3aa...977e4e9. Read the comment docs.

@dapengzhang0
Copy link
Copy Markdown
Contributor Author

cc @WeiranFang, @mgarolera

@dapengzhang0 dapengzhang0 requested a review from a team November 18, 2020 23:40
@dapengzhang0
Copy link
Copy Markdown
Contributor Author

@igorbernstein2, @kolea2, @tritone Could you please review it? Thanks.

cc @apolcyn @mohanli-ml

* "https://github.com/grpc/grpc-proto/blob/master/grpc/service_config/service_config.proto">
* the service config proto definition</a> for more details.
*
* <p>This is public only for technical reasons, for advanced usage.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These two points seem to contradict each other. Rewrite to clarify exactly when and by whom this can be used.

Copy link
Copy Markdown
Contributor Author

@dapengzhang0 dapengzhang0 Dec 7, 2020

Choose a reason for hiding this comment

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

Removed this line in favor of the @InternalApi annotation.

Copy link
Copy Markdown
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM

@Nullable private Credentials credentials;
@Nullable private ChannelPrimer channelPrimer;
@Nullable private Boolean attemptDirectPath;
private ImmutableMap<String, ?> directPathServiceConfig = getDefaultDirectPathServiceConfig();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Builders in gax usually do not have preset values like it is done here. If there is a concept of a default value, then probably it should go the class this builder builds (i.e. essentially move getDefaultDirectPathServiceConfig back to the InstantiatingChannelProvider from its builder).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants