Skip to content

Commit f32a66e

Browse files
Merge branch 'main' into renovate/cloudmonitoring.version
2 parents d113b10 + db0ed07 commit f32a66e

File tree

79 files changed

+25083
-1225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+25083
-1225
lines changed

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/sdk-platform-java/.github/scripts@v2.58.0
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.59.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

.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.48.0
20+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.49.0
2121
with:
2222
bom-path: google-cloud-spanner-bom/pom.xml

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# Changelog
22

3+
## [6.95.1](https://github.com/googleapis/java-spanner/compare/v6.95.0...v6.95.1) (2025-06-06)
4+
5+
6+
### Dependencies
7+
8+
* Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#3909](https://github.com/googleapis/java-spanner/issues/3909)) ([3de8502](https://github.com/googleapis/java-spanner/commit/3de8502b98ebb90526fc2339e279f9b710816b3b))
9+
* Update googleapis/sdk-platform-java action to v2.59.0 ([#3910](https://github.com/googleapis/java-spanner/issues/3910)) ([aed8bd6](https://github.com/googleapis/java-spanner/commit/aed8bd6d5a0b1e0dfab345e0de68f285e8b8aedb))
10+
11+
## [6.95.0](https://github.com/googleapis/java-spanner/compare/v6.94.0...v6.95.0) (2025-06-05)
12+
13+
14+
### Features
15+
16+
* Enable ALTS hard bound token in DirectPath ([#3904](https://github.com/googleapis/java-spanner/issues/3904)) ([2b0f2ff](https://github.com/googleapis/java-spanner/commit/2b0f2ff214f4b68dd5957bc4280edb713b77a763))
17+
* Enable grpc and afe metrics ([#3896](https://github.com/googleapis/java-spanner/issues/3896)) ([706f794](https://github.com/googleapis/java-spanner/commit/706f794f044c2cb1112cfdae6f379e5f2bc3f26f))
18+
* Last statement sample ([#3830](https://github.com/googleapis/java-spanner/issues/3830)) ([2f62816](https://github.com/googleapis/java-spanner/commit/2f62816b0af9aced1b73e25525f60f8e3e923454))
19+
* **spanner:** Add new change_stream.proto ([f385698](https://github.com/googleapis/java-spanner/commit/f38569865de7465ae9a37b844a9dd983571d3688))
20+
21+
22+
### Bug Fixes
23+
24+
* Directpath_enabled attribute ([#3897](https://github.com/googleapis/java-spanner/issues/3897)) ([53bc510](https://github.com/googleapis/java-spanner/commit/53bc510145921d00bc3df04aa4cf407179ed8d8e))
25+
26+
27+
### Dependencies
28+
29+
* Update dependency io.opentelemetry:opentelemetry-bom to v1.50.0 ([#3887](https://github.com/googleapis/java-spanner/issues/3887)) ([94b879c](https://github.com/googleapis/java-spanner/commit/94b879c8c1848fa0b14dbe8cda8390cfe9e8fce6))
30+
31+
## [6.94.0](https://github.com/googleapis/java-spanner/compare/v6.93.0...v6.94.0) (2025-05-21)
32+
33+
34+
### Features
35+
36+
* Add throughput_mode to UpdateDatabaseDdlRequest to be used by Spanner Migration Tool. See https://github.com/GoogleCloudPlatform/spanner-migration-tool ([3070f1d](https://github.com/googleapis/java-spanner/commit/3070f1db97788c2a55c553ab8a4de3419d1ccf5c))
37+
38+
39+
### Bug Fixes
40+
41+
* **deps:** Update the Java code generator (gapic-generator-java) to 2.58.0 ([3070f1d](https://github.com/googleapis/java-spanner/commit/3070f1db97788c2a55c553ab8a4de3419d1ccf5c))
42+
* Remove trailing semicolons in DDL ([#3879](https://github.com/googleapis/java-spanner/issues/3879)) ([ca3a67d](https://github.com/googleapis/java-spanner/commit/ca3a67db715f398943382df1f8a9979905811ff8))
43+
44+
45+
### Dependencies
46+
47+
* Update dependency com.google.cloud:sdk-platform-java-config to v3.48.0 ([#3869](https://github.com/googleapis/java-spanner/issues/3869)) ([afa17f7](https://github.com/googleapis/java-spanner/commit/afa17f73beab80639467916bc73b5c96305093aa))
48+
* Update dependency com.google.cloud:sdk-platform-java-config to v3.48.0 ([#3880](https://github.com/googleapis/java-spanner/issues/3880)) ([f3b00b6](https://github.com/googleapis/java-spanner/commit/f3b00b663aa897fda1bc21222d29726e6be630cb))
49+
* Update dependency com.google.cloud.opentelemetry:exporter-metrics to v0.34.0 ([#3861](https://github.com/googleapis/java-spanner/issues/3861)) ([676b14f](https://github.com/googleapis/java-spanner/commit/676b14f916dea783b40ddec4061bd7af157b5d98))
50+
* Update dependency commons-io:commons-io to v2.19.0 ([#3863](https://github.com/googleapis/java-spanner/issues/3863)) ([80a6af8](https://github.com/googleapis/java-spanner/commit/80a6af836ca29ec196a2f509831e1d36c557168f))
51+
* Update dependency io.opentelemetry:opentelemetry-bom to v1.50.0 ([#3865](https://github.com/googleapis/java-spanner/issues/3865)) ([ae63050](https://github.com/googleapis/java-spanner/commit/ae6305089b394be0c1eaf8ff7e188711288d87ad))
52+
* Update googleapis/sdk-platform-java action to v2.58.0 ([#3870](https://github.com/googleapis/java-spanner/issues/3870)) ([d1e45fa](https://github.com/googleapis/java-spanner/commit/d1e45fa88bb005529bcfb2a6ff2df44065be0fd2))
53+
* Update opentelemetry.version to v1.50.0 ([#3866](https://github.com/googleapis/java-spanner/issues/3866)) ([f7e09b8](https://github.com/googleapis/java-spanner/commit/f7e09b8148c0e51503255694bd3347c637724b34))
54+
55+
56+
### Documentation
57+
58+
* Add samples for unnamed (positional) parameters ([#3849](https://github.com/googleapis/java-spanner/issues/3849)) ([035cadd](https://github.com/googleapis/java-spanner/commit/035cadd5bb77a8f9f6fb25ac8c8e5a3e186d9a22))
59+
360
## [6.93.0](https://github.com/googleapis/java-spanner/compare/v6.92.0...v6.93.0) (2025-05-09)
461

562

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ If you are using Maven without the BOM, add this to your dependencies:
4949
If you are using Gradle 5.x or later, add this to your dependencies:
5050

5151
```Groovy
52-
implementation platform('com.google.cloud:libraries-bom:26.59.0')
52+
implementation platform('com.google.cloud:libraries-bom:26.61.0')
5353
5454
implementation 'com.google.cloud:google-cloud-spanner'
5555
```
5656
If you are using Gradle without BOM, add this to your dependencies:
5757

5858
```Groovy
59-
implementation 'com.google.cloud:google-cloud-spanner:6.93.0'
59+
implementation 'com.google.cloud:google-cloud-spanner:6.95.1'
6060
```
6161

6262
If you are using SBT, add this to your dependencies:
6363

6464
```Scala
65-
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.93.0"
65+
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.95.1"
6666
```
6767

6868
## Authentication
@@ -538,6 +538,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/
538538
| Get Database Ddl Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/GetDatabaseDdlSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/GetDatabaseDdlSample.java) |
539539
| Get Instance Config Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/GetInstanceConfigSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/GetInstanceConfigSample.java) |
540540
| Insert Using Dml Returning Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/InsertUsingDmlReturningSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/InsertUsingDmlReturningSample.java) |
541+
| Last Statement Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/LastStatementSample.java) |
541542
| List Backup Schedules Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/ListBackupSchedulesSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/ListBackupSchedulesSample.java) |
542543
| List Database Roles | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/ListDatabaseRoles.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/ListDatabaseRoles.java) |
543544
| List Databases Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/ListDatabasesSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/ListDatabasesSample.java) |
@@ -554,6 +555,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/
554555
| Pg Drop Sequence Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgDropSequenceSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgDropSequenceSample.java) |
555556
| Pg Insert Using Dml Returning Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgInsertUsingDmlReturningSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgInsertUsingDmlReturningSample.java) |
556557
| Pg Interleaved Table Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgInterleavedTableSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgInterleavedTableSample.java) |
558+
| Pg Last Statement Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgLastStatementSample.java) |
557559
| Pg Partitioned Dml Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgPartitionedDmlSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgPartitionedDmlSample.java) |
558560
| Pg Query With Numeric Parameter Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgQueryWithNumericParameterSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgQueryWithNumericParameterSample.java) |
559561
| Pg Spanner Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java) |
@@ -729,7 +731,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
729731
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html
730732
[stability-image]: https://img.shields.io/badge/stability-stable-green
731733
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg
732-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.93.0
734+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.95.1
733735
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
734736
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
735737
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

benchmarks/pom.xml

Lines changed: 10 additions & 9 deletions
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.93.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
27+
<version>6.95.1</version><!-- {x-version-update:google-cloud-spanner:current} -->
2828
</parent>
2929

3030
<properties>
@@ -34,7 +34,7 @@
3434
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3535
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3636
<junixsocket.version>2.10.1</junixsocket.version>
37-
<opentelemetry.version>1.50.0</opentelemetry.version>
37+
<opentelemetry.version>1.47.0</opentelemetry.version>
3838
</properties>
3939

4040
<dependencies>
@@ -54,7 +54,12 @@
5454
<dependency>
5555
<groupId>com.google.cloud.opentelemetry</groupId>
5656
<artifactId>exporter-metrics</artifactId>
57-
<version>0.34.0</version>
57+
<version>0.33.0</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>com.google.cloud</groupId>
61+
<artifactId>google-cloud-monitoring</artifactId>
62+
<version>3.63.0</version>
5863
</dependency>
5964
<!-- OpenTelemetry test dependencies -->
6065
<dependency>
@@ -94,11 +99,6 @@
9499
<artifactId>google-cloud-spanner</artifactId>
95100
<version>6.93.0</version>
96101
</dependency>
97-
<dependency>
98-
<groupId>commons-cli</groupId>
99-
<artifactId>commons-cli</artifactId>
100-
<version>1.9.0</version>
101-
</dependency>
102102
<dependency>
103103
<groupId>com.google.auto.value</groupId>
104104
<artifactId>auto-value-annotations</artifactId>
@@ -140,8 +140,9 @@
140140
</configuration>
141141
</plugin>
142142
<plugin>
143-
<groupId>com.coveo</groupId>
143+
<groupId>com.spotify.fmt</groupId>
144144
<artifactId>fmt-maven-plugin</artifactId>
145+
<version>2.27</version>
145146
<executions>
146147
<execution>
147148
<goals>

benchmarks/src/main/java/com/google/cloud/spanner/benchmark/AbstractRunner.java

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,80 @@
1818

1919
import java.nio.charset.StandardCharsets;
2020
import java.time.Duration;
21+
import java.time.Instant;
22+
import java.time.temporal.ChronoUnit;
2123
import java.util.ArrayList;
24+
import java.util.HashMap;
25+
import java.util.HashSet;
2226
import java.util.List;
27+
import java.util.Map;
28+
import java.util.Set;
2329
import java.util.concurrent.ExecutorService;
2430
import java.util.concurrent.Future;
2531
import java.util.concurrent.ThreadLocalRandom;
2632
import java.util.concurrent.TimeUnit;
2733
import java.util.concurrent.TimeoutException;
28-
import java.util.concurrent.atomic.AtomicInteger;
2934

3035
abstract class AbstractRunner implements BenchmarkRunner {
31-
static final int TOTAL_RECORDS = 1000000;
32-
static final String SELECT_QUERY = "SELECT ID FROM FOO WHERE ID = @id";
33-
static final String UPDATE_QUERY = "UPDATE FOO SET BAR=1 WHERE ID = @id";
36+
static final int TOTAL_RECORDS = 100000;
37+
static final String TABLE_NAME = "Employees";
38+
static final String SELECT_QUERY = String.format("SELECT ID FROM %s WHERE ID = @id", TABLE_NAME);
39+
static final String UPDATE_QUERY =
40+
String.format("UPDATE %s SET Name=Google WHERE ID = @id", TABLE_NAME);
3441
static final String ID_COLUMN_NAME = "id";
35-
static final String SERVER_URL = "https://staging-wrenchworks.sandbox.googleapis.com";
42+
static final Map<Environment, String> SERVER_URL_MAPPING = new HashMap<>();
3643

37-
private final AtomicInteger operationCounter = new AtomicInteger();
44+
static {
45+
SERVER_URL_MAPPING.put(
46+
Environment.CLOUD_DEVEL, "https://staging-wrenchworks.sandbox.googleapis.com");
47+
SERVER_URL_MAPPING.put(Environment.PROD, "https://spanner.googleapis.com");
48+
}
49+
50+
Map<Integer, TimerConfiguration> timerConfigurations = new HashMap<>();
51+
private final Set<Integer> completedClients = new HashSet<>();
52+
private final Set<Integer> finishedClients = new HashSet<>();
53+
54+
protected void initiateTimer(int clientId, String message, Instant endTime) {
55+
TimerConfiguration timerConfiguration =
56+
timerConfigurations.getOrDefault(clientId, new TimerConfiguration());
57+
timerConfiguration.setMessage(message);
58+
timerConfiguration.setEndTime(endTime);
59+
timerConfigurations.put(clientId, timerConfiguration);
60+
}
3861

39-
protected void incOperations() {
40-
operationCounter.incrementAndGet();
62+
protected void setBenchmarkingCompleted(int clientId) {
63+
this.completedClients.add(clientId);
4164
}
4265

4366
protected List<Duration> collectResults(
4467
ExecutorService service,
4568
List<Future<List<Duration>>> results,
46-
int numClients,
47-
int numOperations)
69+
BenchmarkingConfiguration configuration)
4870
throws Exception {
49-
int totalOperations = numClients * numOperations;
71+
while (!(finishedClients.size() == configuration.getNumOfClients()))
72+
for (int i = 0; i < configuration.getNumOfClients(); i++) {
73+
TimerConfiguration timerConfiguration =
74+
timerConfigurations.getOrDefault(i, new TimerConfiguration());
75+
long totalSeconds =
76+
ChronoUnit.SECONDS.between(Instant.now(), timerConfiguration.getEndTime());
77+
if (completedClients.contains(i)) {
78+
if (!finishedClients.contains(i)) {
79+
System.out.printf("Client %s: Completed", i);
80+
finishedClients.add(i);
81+
}
82+
} else {
83+
System.out.printf(
84+
"Client %s: %s %s Minutes %s Seconds\r",
85+
i + 1, timerConfiguration.getMessage(), totalSeconds / 60, totalSeconds % 60);
86+
}
87+
//noinspection BusyWait
88+
Thread.sleep(1000L);
89+
}
5090
service.shutdown();
51-
while (!service.isTerminated()) {
52-
//noinspection BusyWait
53-
Thread.sleep(1000L);
54-
System.out.printf("\r%d/%d", operationCounter.get(), totalOperations);
55-
}
56-
System.out.println();
5791
if (!service.awaitTermination(60L, TimeUnit.MINUTES)) {
5892
throw new TimeoutException();
5993
}
60-
List<Duration> allResults = new ArrayList<>(numClients * numOperations);
94+
List<Duration> allResults = new ArrayList<>();
6195
for (Future<List<Duration>> result : results) {
6296
allResults.addAll(result.get());
6397
}
@@ -77,4 +111,25 @@ protected String generateRandomString() {
77111
ThreadLocalRandom.current().nextBytes(bytes);
78112
return new String(bytes, StandardCharsets.UTF_8);
79113
}
114+
115+
static class TimerConfiguration {
116+
private Instant endTime = Instant.now();
117+
private String message = "Waiting for benchmarks to start...";
118+
119+
Instant getEndTime() {
120+
return endTime;
121+
}
122+
123+
void setEndTime(Instant endTime) {
124+
this.endTime = endTime;
125+
}
126+
127+
String getMessage() {
128+
return message;
129+
}
130+
131+
void setMessage(String message) {
132+
this.message = message;
133+
}
134+
}
80135
}

0 commit comments

Comments
 (0)