-
Notifications
You must be signed in to change notification settings - Fork 123
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: increase default number of channels when gRPC-GCP channel pool is enabled #1997
Conversation
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
Outdated
Show resolved
Hide resolved
Try running |
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
…annerOptions.java
…annerOptions.java
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit on setting the default numChannels
, otherwise LGTM
if (this.numChannels == null) { | ||
this.numChannels = GRPC_GCP_ENABLED_DEFAULT_CHANNELS; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this and instead assign the default number of channels in the build method for both GCP enabled and disabled. (See also below)
@@ -1166,6 +1172,10 @@ public SpannerOptions build() { | |||
// As we are using plain text, we should never send any credentials. | |||
this.setCredentials(NoCredentials.getInstance()); | |||
} | |||
if (this.numChannels == null) { | |||
this.numChannels = DEFAULT_CHANNELS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.num
this.numChannels = DEFAULT_CHANNELS; | |
this.numChannels = this.grpcGcpExtensionEnabled ? GRPC_GCP_ENABLED_DEFAULT_CHANNELS : DEFAULT_CHANNELS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion @olavloite. This makes it more readable than the previous one.
I have made the changes in the recent commit.
🤖 I have created a release *beep* *boop* --- ## [6.32.0](https://togithub.com/googleapis/java-spanner/compare/v6.31.2...v6.32.0) (2022-10-27) ### Features * Enable client to server compression ([#2117](https://togithub.com/googleapis/java-spanner/issues/2117)) ([50f8425](https://togithub.com/googleapis/java-spanner/commit/50f8425fe9e1db16ed060337d26feccc9a9813e2)) * Increase default number of channels when gRPC-GCP channel pool is enabled ([#1997](https://togithub.com/googleapis/java-spanner/issues/1997)) ([44f27fc](https://togithub.com/googleapis/java-spanner/commit/44f27fc90fa3f9f4914574fb0476e971da4c02ff)) * Update result_set.proto to return undeclared parameters in ExecuteSql API ([#2101](https://togithub.com/googleapis/java-spanner/issues/2101)) ([826eb93](https://togithub.com/googleapis/java-spanner/commit/826eb9305095db064f52a15dc502bc0e0df9a984)) ### Dependencies * Update dependency com.google.cloud:google-cloud-monitoring to v3.4.6 ([#2093](https://togithub.com/googleapis/java-spanner/issues/2093)) ([b08db44](https://togithub.com/googleapis/java-spanner/commit/b08db443229afdc1d49ef9f5e459cade5e2abe90)) * Update dependency com.google.cloud:google-cloud-monitoring to v3.5.0 ([#2113](https://togithub.com/googleapis/java-spanner/issues/2113)) ([99d825b](https://togithub.com/googleapis/java-spanner/commit/99d825b18397ff9e8633b89effa05e61159d956f)) * Update dependency com.google.cloud:google-cloud-monitoring to v3.6.0 ([#2125](https://togithub.com/googleapis/java-spanner/issues/2125)) ([7d86fe4](https://togithub.com/googleapis/java-spanner/commit/7d86fe40de29311ad65bd382e55f75326d16c4e3)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#2122](https://togithub.com/googleapis/java-spanner/issues/2122)) ([308a65c](https://togithub.com/googleapis/java-spanner/commit/308a65c3e07e33f82b7ce474e0e95099192bb593)) * Update dependency com.google.cloud:google-cloud-trace to v2.3.7 ([#2094](https://togithub.com/googleapis/java-spanner/issues/2094)) ([6ec3f3f](https://togithub.com/googleapis/java-spanner/commit/6ec3f3f585ed5eaecdb09d5fd1eb6c9af3b22555)) * Update dependency com.google.cloud:google-cloud-trace to v2.4.0 ([#2114](https://togithub.com/googleapis/java-spanner/issues/2114)) ([84347f1](https://togithub.com/googleapis/java-spanner/commit/84347f1c6a52f3dfe569649f061cb16e2e466f6a)) * Update dependency com.google.cloud:google-cloud-trace to v2.5.0 ([#2126](https://togithub.com/googleapis/java-spanner/issues/2126)) ([5167928](https://togithub.com/googleapis/java-spanner/commit/516792809cf976aeab10709ca62503b7f03bb333)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.15 ([#2109](https://togithub.com/googleapis/java-spanner/issues/2109)) ([bf092ad](https://togithub.com/googleapis/java-spanner/commit/bf092ad7ac86c500e8a445397e192cb8fb0594ae)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.16 ([#2119](https://togithub.com/googleapis/java-spanner/issues/2119)) ([b2d27e8](https://togithub.com/googleapis/java-spanner/commit/b2d27e8f841cab096d5ccad64a250c7f0b35f670)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 ([#2110](https://togithub.com/googleapis/java-spanner/issues/2110)) ([d28b202](https://togithub.com/googleapis/java-spanner/commit/d28b202cfc29e8fbbfdf3612b94bab5c2f319419)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 ([#2120](https://togithub.com/googleapis/java-spanner/issues/2120)) ([151cf77](https://togithub.com/googleapis/java-spanner/commit/151cf778ff76edaee9e849181f72119ffa6cb897)) * Update dependency org.graalvm.sdk:graal-sdk to v22.2.0.1 ([#2102](https://togithub.com/googleapis/java-spanner/issues/2102)) ([68c2089](https://togithub.com/googleapis/java-spanner/commit/68c2089101124b9887af57b2697c35a64eb1a51f)) * Update dependency org.graalvm.sdk:graal-sdk to v22.3.0 ([#2116](https://togithub.com/googleapis/java-spanner/issues/2116)) ([9d6930b](https://togithub.com/googleapis/java-spanner/commit/9d6930b77ec479e5f517236852244476c23dc5c8)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Fixes #1566