Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit c6c83b9

Browse files
committed
Merge branch 'main' into PR #3928 to update
2 parents 8950c3d + f7d0abc commit c6c83b9

20 files changed

Lines changed: 527 additions & 54 deletions

File tree

.github/workflows/unmanaged_dependency_check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
# repository
1818
.kokoro/build.sh
1919
- name: Unmanaged dependency check
20-
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.55.1
20+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.56.0
2121
with:
2222
bom-path: google-cloud-spanner-bom/pom.xml

benchmarks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>com.google.cloud</groupId>
2626
<artifactId>google-cloud-spanner-parent</artifactId>
27-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
27+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
2828
</parent>
2929

3030
<properties>

google-cloud-spanner-bom/pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-spanner-bom</artifactId>
6-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
6+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
77
<packaging>pom</packaging>
88
<parent>
99
<groupId>com.google.cloud</groupId>
1010
<artifactId>sdk-platform-java-config</artifactId>
11-
<version>3.55.1</version>
11+
<version>3.56.0</version>
1212
</parent>
1313

1414
<name>Google Cloud Spanner BOM</name>
@@ -53,43 +53,43 @@
5353
<dependency>
5454
<groupId>com.google.cloud</groupId>
5555
<artifactId>google-cloud-spanner</artifactId>
56-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
56+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
5757
</dependency>
5858
<dependency>
5959
<groupId>com.google.cloud</groupId>
6060
<artifactId>google-cloud-spanner</artifactId>
6161
<type>test-jar</type>
62-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
62+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
6363
</dependency>
6464
<dependency>
6565
<groupId>com.google.api.grpc</groupId>
6666
<artifactId>grpc-google-cloud-spanner-v1</artifactId>
67-
<version>6.107.0</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
67+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
6868
</dependency>
6969
<dependency>
7070
<groupId>com.google.api.grpc</groupId>
7171
<artifactId>grpc-google-cloud-spanner-admin-instance-v1</artifactId>
72-
<version>6.107.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
72+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
7373
</dependency>
7474
<dependency>
7575
<groupId>com.google.api.grpc</groupId>
7676
<artifactId>grpc-google-cloud-spanner-admin-database-v1</artifactId>
77-
<version>6.107.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
77+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
7878
</dependency>
7979
<dependency>
8080
<groupId>com.google.api.grpc</groupId>
8181
<artifactId>proto-google-cloud-spanner-admin-instance-v1</artifactId>
82-
<version>6.107.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
82+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
8383
</dependency>
8484
<dependency>
8585
<groupId>com.google.api.grpc</groupId>
8686
<artifactId>proto-google-cloud-spanner-v1</artifactId>
87-
<version>6.107.0</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
87+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
8888
</dependency>
8989
<dependency>
9090
<groupId>com.google.api.grpc</groupId>
9191
<artifactId>proto-google-cloud-spanner-admin-database-v1</artifactId>
92-
<version>6.107.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
92+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
9393
</dependency>
9494
</dependencies>
9595
</dependencyManagement>

google-cloud-spanner-executor/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.google.cloud</groupId>
77
<artifactId>google-cloud-spanner-executor</artifactId>
8-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner-executor:current} -->
8+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner-executor:current} -->
99
<packaging>jar</packaging>
1010
<name>Google Cloud Spanner Executor</name>
1111

1212
<parent>
1313
<groupId>com.google.cloud</groupId>
1414
<artifactId>google-cloud-spanner-parent</artifactId>
15-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
15+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1616
</parent>
1717

1818
<properties>

google-cloud-spanner/pom.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-spanner</artifactId>
6-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
6+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
77
<packaging>jar</packaging>
88
<name>Google Cloud Spanner</name>
99
<url>https://github.com/googleapis/java-spanner</url>
1010
<description>Java idiomatic client for Google Cloud Spanner.</description>
1111
<parent>
1212
<groupId>com.google.cloud</groupId>
1313
<artifactId>google-cloud-spanner-parent</artifactId>
14-
<version>6.107.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
14+
<version>6.107.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
1515
</parent>
1616
<properties>
1717
<site.installationModule>google-cloud-spanner</site.installationModule>
@@ -166,6 +166,12 @@
166166
<dependency>
167167
<groupId>com.google.cloud</groupId>
168168
<artifactId>grpc-gcp</artifactId>
169+
<exclusions>
170+
<exclusion>
171+
<groupId>io.opentelemetry</groupId>
172+
<artifactId>opentelemetry-api</artifactId>
173+
</exclusion>
174+
</exclusions>
169175
</dependency>
170176
<dependency>
171177
<groupId>io.grpc</groupId>
@@ -198,6 +204,12 @@
198204
<dependency>
199205
<groupId>io.grpc</groupId>
200206
<artifactId>grpc-opentelemetry</artifactId>
207+
<exclusions>
208+
<exclusion>
209+
<groupId>io.opentelemetry</groupId>
210+
<artifactId>opentelemetry-api</artifactId>
211+
</exclusion>
212+
</exclusions>
201213
</dependency>
202214
<dependency>
203215
<groupId>com.google.api</groupId>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.spanner.spi.v1;
18+
19+
import com.google.api.core.InternalApi;
20+
import io.grpc.ManagedChannel;
21+
22+
/**
23+
* Represents a Spanner server endpoint for location-aware routing.
24+
*
25+
* <p>Each instance wraps a gRPC {@link ManagedChannel} connected to a specific Spanner server. The
26+
* {@link ChannelEndpointCache} creates and caches these instances.
27+
*
28+
* <p>Implementations must be thread-safe as instances may be shared across multiple concurrent
29+
* operations.
30+
*
31+
* @see ChannelEndpointCache
32+
*/
33+
@InternalApi
34+
public interface ChannelEndpoint {
35+
36+
/**
37+
* Returns the network address of this server.
38+
*
39+
* @return the server address in "host:port" format
40+
*/
41+
String getAddress();
42+
43+
/**
44+
* Returns whether this server is ready to accept RPCs.
45+
*
46+
* <p>A server is considered unhealthy if:
47+
*
48+
* <ul>
49+
* <li>The underlying channel is shutdown or terminated
50+
* <li>The channel is in a transient failure state
51+
* </ul>
52+
*
53+
* @return true if the server is healthy and ready to accept RPCs
54+
*/
55+
boolean isHealthy();
56+
57+
/**
58+
* Returns the gRPC channel for making RPCs to this server.
59+
*
60+
* <p>The returned channel is managed by the {@link ChannelEndpointCache} and should not be shut
61+
* down directly by callers.
62+
*
63+
* @return the managed channel for this server
64+
*/
65+
ManagedChannel getChannel();
66+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.spanner.spi.v1;
18+
19+
import com.google.api.core.InternalApi;
20+
21+
/**
22+
* Cache for server connections used in location-aware routing.
23+
*
24+
* <p>Implementations are expected to cache {@link ChannelEndpoint} instances such that repeated
25+
* calls with the same address return the same instance. This allows routing components to
26+
* efficiently manage server references.
27+
*
28+
* <p>Implementations must be thread-safe. Multiple threads may concurrently call {@link
29+
* #get(String)} with different addresses.
30+
*/
31+
@InternalApi
32+
public interface ChannelEndpointCache {
33+
34+
/**
35+
* Returns the default channel endpoint.
36+
*
37+
* <p>The default channel is the original endpoint configured in {@link
38+
* com.google.cloud.spanner.SpannerOptions}. It is used as a fallback when the location cache does
39+
* not have routing information for a request.
40+
*
41+
* @return the default channel, never null
42+
*/
43+
ChannelEndpoint defaultChannel();
44+
45+
/**
46+
* Returns a cached server for the given address, creating it if needed.
47+
*
48+
* <p>If a server for this address already exists in the cache, the cached instance is returned.
49+
* Otherwise, a new server connection is created and cached.
50+
*
51+
* @param address the server address in "host:port" format
52+
* @return a server instance for the address, never null
53+
* @throws com.google.cloud.spanner.SpannerException if the channel cannot be created
54+
*/
55+
ChannelEndpoint get(String address);
56+
57+
/**
58+
* Evicts a server from the cache and gracefully shuts down its channel.
59+
*
60+
* <p>This method should be called when a server becomes unhealthy or is no longer needed. The
61+
* channel shutdown is graceful: existing RPCs are allowed to complete, but new RPCs will not be
62+
* accepted on this channel.
63+
*
64+
* <p>If the address is not in the cache, this method does nothing.
65+
*
66+
* @param address the server address to evict
67+
*/
68+
void evict(String address);
69+
70+
/**
71+
* Shuts down all cached server connections.
72+
*
73+
* <p>This method should be called when the Spanner client is closed to release all resources.
74+
* Each channel is shut down gracefully, allowing in-flight RPCs to complete.
75+
*
76+
* <p>After calling this method, the cache should not be used to create new connections.
77+
*/
78+
void shutdown();
79+
}

0 commit comments

Comments
 (0)