Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat: add gRPC-GCP channel pool as an option (#1227)
* add grpc-gcp extensions * remove local files * update read apiconfig * update read apiconfig * Add custom pool size for GCP extension * add one more entry in aip config file * change gcp package name * Adjust grpc-gcp package name and group * Set grpc-gcp low streams watermark to 1 This allows sessions to be spread across channels when the Spanner client starts up. * Add gRPC-GCP extension options to SpannerOptions * feat: add gRPC-GCP channel pool as an option This enables a user to opt-in for using the gRPC-GCP extension channel pool and configure its options. * Addressed comments. * Fixed linting issues. * Add integration test with enabled gRPC-GCP extension * Remake gRPC-GCP extension related SpannerOptions * Add ChannelUsageTest Co-authored-by: Zhenli(Jenny) Jiang <jennyjiang@google.com> Co-authored-by: Knut Olav Løite <koloite@gmail.com>
- Loading branch information
Showing
with
569 additions
and 2 deletions.
- +6 −0 google-cloud-spanner/pom.xml
- +39 −2 google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
- +68 −0 google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
- +106 −0 google-cloud-spanner/src/main/resources/com/google/cloud/spanner/spi/v1/grpc-gcp-apiconfig.json
- +235 −0 google-cloud-spanner/src/test/java/com/google/cloud/spanner/ChannelUsageTest.java
- +115 −0 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWithGrpcGcpTest.java
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
@@ -0,0 +1,106 @@ | ||
{ | ||
"channelPool": { | ||
"maxSize": 3, | ||
"maxConcurrentStreamsLowWatermark": 0 | ||
}, | ||
"method": [ | ||
{ | ||
"name": ["google.spanner.v1.Spanner/CreateSession"], | ||
"affinity" : { | ||
"command": "BIND", | ||
"affinityKey": "name" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/BatchCreateSessions"], | ||
"affinity" : { | ||
"command": "BIND", | ||
"affinityKey": "session.name" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/GetSession"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "name" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/DeleteSession"], | ||
"affinity": { | ||
"command": "UNBIND", | ||
"affinityKey": "name" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/ExecuteSql"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/ExecuteBatchDml"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/ExecuteStreamingSql"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/Read"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/StreamingRead"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/BeginTransaction"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/Commit"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/PartitionRead"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/PartitionQuery"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
}, | ||
{ | ||
"name": ["google.spanner.v1.Spanner/Rollback"], | ||
"affinity": { | ||
"command": "BOUND", | ||
"affinityKey": "session" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.