Skip to content

feat: increase default number of channels when gRPC-GCP channel pool is enabled #1997

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

Merged
merged 19 commits into from
Oct 19, 2022
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/Sp…
…annerOptions.java
  • Loading branch information
rajatbhatta authored Sep 7, 2022
commit 5f516cb7a8b7925416858b09cd798c59173d1432
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ public SpannerOptions build() {
// As we are using plain text, we should never send any credentials.
this.setCredentials(NoCredentials.getInstance());
}
// Set the number of channels if not set
// Set the number of channels to DEFAULT_CHANNELS if not set
if (this.numChannels == null) {
// By default, we create 4 channels per {@link SpannerOptions}
this.numChannels = DEFAULT_CHANNELS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this.num

Suggested change
this.numChannels = DEFAULT_CHANNELS;
this.numChannels = this.grpcGcpExtensionEnabled ? GRPC_GCP_ENABLED_DEFAULT_CHANNELS : DEFAULT_CHANNELS;

Copy link
Contributor Author

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.

Expand Down