- Notifications
You must be signed in to change notification settings - Fork 136
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
Changes from 2 commits
Commits
Show all changes
19 commits Select commit Hold shift + click to select a range
4b44b1a increase default number of channels when grpc-gcp channel pool is ena…
harshachinta 34d7623 Merge remote-tracking branch 'origin/main'
harshachinta 860462a add java file header
harshachinta f2e2d8f increase default number of channels when grpc-gcp channel pool is ena…
harshachinta 15e3155 fix lint issue
harshachinta 7a3ed3c fix lint issue
harshachinta 1449429 code fixes
harshachinta 5f516cb Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/Sp…
rajatbhatta afec666 Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/Sp…
rajatbhatta 1fe3d48 lint fixes
harshachinta 60cfa2a Merge remote-tracking branch 'origin/main'
harshachinta e68b2f5 Modify comments for better code readability
harshachinta a334e09 lint fix
harshachinta 27962ea add test to verify default num of channels when gRPC-GCP is not enabled
harshachinta 68e72d4 Add tests to verify number of channels and the instances created
harshachinta 33682fc 🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] faa74ed code refactoring for setting the default numChannels
harshachinta 3d81b1f Merge remote-tracking branch 'origin/main'
harshachinta a88d4e3 lint fix
harshachinta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions 64 google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultNumChannelsTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| package com.google.cloud.spanner; | ||
| | ||
| import static com.google.common.truth.Truth.assertThat; | ||
| | ||
| import org.junit.Test; | ||
| import org.junit.runner.RunWith; | ||
| import org.junit.runners.JUnit4; | ||
| | ||
| @RunWith(JUnit4.class) | ||
| public class DefaultNumChannelsTest { | ||
| | ||
| // With GRPC GCP channel pool enabled | ||
| @Test | ||
| public void testDefaultNumChannelsWithGrpcGcpEnabled() { | ||
harshachinta marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| SpannerOptions.Builder builder = SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .enableGrpcGcpExtension(); | ||
| | ||
| SpannerOptions options = builder.build(); | ||
| assertThat(options.getNumChannels()).isEqualTo(8); | ||
harshachinta marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| } | ||
| | ||
| @Test | ||
| public void testNumChannelsWithGrpcGcpEnabledLater() { | ||
| SpannerOptions.Builder builder = SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setNumChannels(5) | ||
| .enableGrpcGcpExtension(); | ||
| | ||
| SpannerOptions options = builder.build(); | ||
| assertThat(options.getNumChannels()).isEqualTo(5); | ||
| } | ||
| | ||
| @Test | ||
| public void testNumChannelsWithGrpcGcpEnabled() { | ||
| SpannerOptions.Builder builder = SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .enableGrpcGcpExtension() | ||
| .setNumChannels(5); | ||
| | ||
| SpannerOptions options = builder.build(); | ||
| assertThat(options.getNumChannels()).isEqualTo(5); | ||
| } | ||
harshachinta marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| // Without enabling GRPC GCP channel pool | ||
| @Test | ||
| public void testDefaultNumChannelsWithOutGrpcGcpEnabled() { | ||
| SpannerOptions.Builder builder = SpannerOptions.newBuilder() | ||
| .setProjectId("test-project"); | ||
| | ||
| SpannerOptions options = builder.build(); | ||
| assertThat(options.getNumChannels()).isEqualTo(4); | ||
| } | ||
| | ||
| @Test | ||
| public void testNumChannelsWithOutGrpcGcpEnabled() { | ||
| SpannerOptions.Builder builder = SpannerOptions.newBuilder() | ||
| .setProjectId("test-project") | ||
| .setNumChannels(7); | ||
| | ||
| SpannerOptions options = builder.build(); | ||
| assertThat(options.getNumChannels()).isEqualTo(7); | ||
| } | ||
| } | ||
harshachinta marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.