From 64bc8c3ac403531a8165f93fddbc6aba580ce610 Mon Sep 17 00:00:00 2001
From: "release-please[bot]"
<55107282+release-please[bot]@users.noreply.github.com>
Date: Mon, 18 Jan 2021 09:36:04 +0000
Subject: [PATCH 01/42] chore: release 3.3.3-SNAPSHOT (#811)
:robot: I have created a release \*beep\* \*boop\*
---
### Updating meta-information for bleeding-edge SNAPSHOT release.
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
---
google-cloud-spanner-bom/pom.xml | 18 +++++++++---------
google-cloud-spanner/pom.xml | 4 ++--
.../pom.xml | 4 ++--
.../pom.xml | 4 ++--
grpc-google-cloud-spanner-v1/pom.xml | 4 ++--
pom.xml | 16 ++++++++--------
.../pom.xml | 4 ++--
.../pom.xml | 4 ++--
proto-google-cloud-spanner-v1/pom.xml | 4 ++--
samples/snapshot/pom.xml | 2 +-
versions.txt | 14 +++++++-------
11 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml
index 2e6d7695172..41e4a0c513c 100644
--- a/google-cloud-spanner-bom/pom.xml
+++ b/google-cloud-spanner-bom/pom.xml
@@ -3,7 +3,7 @@
4.0.0com.google.cloudgoogle-cloud-spanner-bom
- 3.3.2
+ 3.3.3-SNAPSHOTpomcom.google.cloud
@@ -64,43 +64,43 @@
com.google.api.grpcproto-google-cloud-spanner-admin-instance-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-spanner-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcproto-google-cloud-spanner-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcproto-google-cloud-spanner-admin-database-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.cloudgoogle-cloud-spanner
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.cloudgoogle-cloud-spannertest-jar
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-spanner-admin-instance-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-spanner-admin-database-v1
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml
index f27a5be556d..0ca5a2b953b 100644
--- a/google-cloud-spanner/pom.xml
+++ b/google-cloud-spanner/pom.xml
@@ -3,7 +3,7 @@
4.0.0com.google.cloudgoogle-cloud-spanner
- 3.3.2
+ 3.3.3-SNAPSHOTjarGoogle Cloud Spannerhttps://github.com/googleapis/java-spanner
@@ -11,7 +11,7 @@
com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOTgoogle-cloud-spanner
diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml
index 1a7a0d889fb..869511d6101 100644
--- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml
+++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0com.google.api.grpcgrpc-google-cloud-spanner-admin-database-v1
- 3.3.2
+ 3.3.3-SNAPSHOTgrpc-google-cloud-spanner-admin-database-v1GRPC library for grpc-google-cloud-spanner-admin-database-v1com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml
index f51f2e89dc2..f58baec738d 100644
--- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml
+++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0com.google.api.grpcgrpc-google-cloud-spanner-admin-instance-v1
- 3.3.2
+ 3.3.3-SNAPSHOTgrpc-google-cloud-spanner-admin-instance-v1GRPC library for grpc-google-cloud-spanner-admin-instance-v1com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml
index 059e8e02945..34324a8acd2 100644
--- a/grpc-google-cloud-spanner-v1/pom.xml
+++ b/grpc-google-cloud-spanner-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0com.google.api.grpcgrpc-google-cloud-spanner-v1
- 3.3.2
+ 3.3.3-SNAPSHOTgrpc-google-cloud-spanner-v1GRPC library for grpc-google-cloud-spanner-v1com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/pom.xml b/pom.xml
index f8d4aa31c19..11254547acb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.google.cloudgoogle-cloud-spanner-parentpom
- 3.3.2
+ 3.3.3-SNAPSHOTGoogle Cloud Spanner Parenthttps://github.com/googleapis/java-spanner
@@ -71,37 +71,37 @@
com.google.api.grpcproto-google-cloud-spanner-admin-instance-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcproto-google-cloud-spanner-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcproto-google-cloud-spanner-admin-database-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-spanner-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-spanner-admin-instance-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.api.grpcgrpc-google-cloud-spanner-admin-database-v1
- 3.3.2
+ 3.3.3-SNAPSHOTcom.google.cloudgoogle-cloud-spanner
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml
index f4c05bbb57f..8b046befb56 100644
--- a/proto-google-cloud-spanner-admin-database-v1/pom.xml
+++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0com.google.api.grpcproto-google-cloud-spanner-admin-database-v1
- 3.3.2
+ 3.3.3-SNAPSHOTproto-google-cloud-spanner-admin-database-v1PROTO library for proto-google-cloud-spanner-admin-database-v1com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml
index 26298e14ca7..fd769578fe2 100644
--- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml
+++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0com.google.api.grpcproto-google-cloud-spanner-admin-instance-v1
- 3.3.2
+ 3.3.3-SNAPSHOTproto-google-cloud-spanner-admin-instance-v1PROTO library for proto-google-cloud-spanner-admin-instance-v1com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml
index e2c914656e7..b30399bf7cf 100644
--- a/proto-google-cloud-spanner-v1/pom.xml
+++ b/proto-google-cloud-spanner-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0com.google.api.grpcproto-google-cloud-spanner-v1
- 3.3.2
+ 3.3.3-SNAPSHOTproto-google-cloud-spanner-v1PROTO library for proto-google-cloud-spanner-v1com.google.cloudgoogle-cloud-spanner-parent
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 6dbbf8567bc..bec35d771e8 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -31,7 +31,7 @@
com.google.cloudgoogle-cloud-spanner
- 3.3.2
+ 3.3.3-SNAPSHOT
diff --git a/versions.txt b/versions.txt
index 0664f8f8d34..e458c81d7ac 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,10 +1,10 @@
# Format:
# module:released-version:current-version
-proto-google-cloud-spanner-admin-instance-v1:3.3.2:3.3.2
-proto-google-cloud-spanner-v1:3.3.2:3.3.2
-proto-google-cloud-spanner-admin-database-v1:3.3.2:3.3.2
-grpc-google-cloud-spanner-v1:3.3.2:3.3.2
-grpc-google-cloud-spanner-admin-instance-v1:3.3.2:3.3.2
-grpc-google-cloud-spanner-admin-database-v1:3.3.2:3.3.2
-google-cloud-spanner:3.3.2:3.3.2
\ No newline at end of file
+proto-google-cloud-spanner-admin-instance-v1:3.3.2:3.3.3-SNAPSHOT
+proto-google-cloud-spanner-v1:3.3.2:3.3.3-SNAPSHOT
+proto-google-cloud-spanner-admin-database-v1:3.3.2:3.3.3-SNAPSHOT
+grpc-google-cloud-spanner-v1:3.3.2:3.3.3-SNAPSHOT
+grpc-google-cloud-spanner-admin-instance-v1:3.3.2:3.3.3-SNAPSHOT
+grpc-google-cloud-spanner-admin-database-v1:3.3.2:3.3.3-SNAPSHOT
+google-cloud-spanner:3.3.2:3.3.3-SNAPSHOT
\ No newline at end of file
From df2b8df20217293045ff3c2751a134ca33468dd6 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Mon, 18 Jan 2021 03:12:02 -0800
Subject: [PATCH 02/42] chore: regenerate README (#813)
This PR was generated using Autosynth. :rainbow:
Log from Synthtool
```
2021-01-18 09:46:57,836 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-01-18 09:46:58,779 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.
```
Full log will be available here:
https://source.cloud.google.com/results/invocations/4a681427-c53c-478a-ab6d-62cdbfd4a9f7/targets
- [ ] To automatically regenerate this PR, check this box.
---
.github/readme/synth.metadata/synth.metadata | 2 +-
README.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata
index c23ee933f30..1a1e67bcad1 100644
--- a/.github/readme/synth.metadata/synth.metadata
+++ b/.github/readme/synth.metadata/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "5f3a67ad3a5213fa9fca977ebe4abb50ccd3f593"
+ "sha": "64bc8c3ac403531a8165f93fddbc6aba580ce610"
}
},
{
diff --git a/README.md b/README.md
index 4228838d64e..f5db3b08a64 100644
--- a/README.md
+++ b/README.md
@@ -51,12 +51,12 @@ compile 'com.google.cloud:google-cloud-spanner'
```
If you are using Gradle without BOM, add this to your dependencies
```Groovy
-compile 'com.google.cloud:google-cloud-spanner:3.3.1'
+compile 'com.google.cloud:google-cloud-spanner:3.3.2'
```
If you are using SBT, add this to your dependencies
```Scala
-libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "3.3.1"
+libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "3.3.2"
```
## Authentication
From fadb4011e554d0554332ac47e1c0060afca9ffeb Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Tue, 19 Jan 2021 00:19:05 +0100
Subject: [PATCH 03/42] chore(deps): update dependency
com.google.cloud:google-cloud-spanner to v3.3.2 (#812)
---
samples/install-without-bom/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 46b615b5cf2..9be81c3b67c 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -32,7 +32,7 @@
com.google.cloudgoogle-cloud-spanner
- 3.3.1
+ 3.3.2
From 4aa770ce669404ad0eca542ae5bd32a421748c18 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Mon, 18 Jan 2021 15:54:03 -0800
Subject: [PATCH 04/42] chore: regenerate README (#814)
This PR was generated using Autosynth. :rainbow:
Log from Synthtool
```
2021-01-18 23:21:19,860 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-01-18 23:21:20,804 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.
```
Full log will be available here:
https://source.cloud.google.com/results/invocations/daacbf96-4788-473a-9677-036a2ff8bd8c/targets
- [ ] To automatically regenerate this PR, check this box.
---
.github/readme/synth.metadata/synth.metadata | 2 +-
README.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata
index 1a1e67bcad1..54018735ad9 100644
--- a/.github/readme/synth.metadata/synth.metadata
+++ b/.github/readme/synth.metadata/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "64bc8c3ac403531a8165f93fddbc6aba580ce610"
+ "sha": "fadb4011e554d0554332ac47e1c0060afca9ffeb"
}
},
{
diff --git a/README.md b/README.md
index f5db3b08a64..1ddee68fa74 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ If you are using Maven without BOM, add this to your dependencies:
com.google.cloudgoogle-cloud-spanner
- 3.3.1
+ 3.3.2
```
From 80d3585870b81949ec641291e5a88fe391f78e27 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Fri, 22 Jan 2021 16:55:42 -0800
Subject: [PATCH 05/42] feat: add option for returning Spanner commit stats
(#817)
PiperOrigin-RevId: 353145174
Source-Author: Google APIs
Source-Date: Thu Jan 21 18:06:01 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 8fa381b7138f1d72966ff20563efae1b2194d359
Source-Link: https://github.com/googleapis/googleapis/commit/8fa381b7138f1d72966ff20563efae1b2194d359
---
.../cloud/spanner/v1/SpannerClient.java | 30 +
.../cloud/spanner/v1/SpannerClientTest.java | 20 +-
.../com/google/spanner/v1/SpannerGrpc.java | 20 +
.../com/google/spanner/v1/CommitRequest.java | 98 ++
.../spanner/v1/CommitRequestOrBuilder.java | 15 +
.../com/google/spanner/v1/CommitResponse.java | 882 ++++++++++++++++++
.../spanner/v1/CommitResponseOrBuilder.java | 41 +
.../google/spanner/v1/ExecuteSqlRequest.java | 87 +-
.../v1/ExecuteSqlRequestOrBuilder.java | 15 +-
.../java/com/google/spanner/v1/Session.java | 128 ++-
.../google/spanner/v1/SessionOrBuilder.java | 31 +-
.../com/google/spanner/v1/SpannerProto.java | 407 ++++----
.../com/google/spanner/v1/StructType.java | 18 +-
.../google/spanner/v1/TransactionOptions.java | 18 +-
.../proto/google/spanner/v1/spanner.proto | 46 +-
.../proto/google/spanner/v1/transaction.proto | 9 +-
.../main/proto/google/spanner/v1/type.proto | 2 +-
synth.metadata | 6 +-
18 files changed, 1558 insertions(+), 315 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java
index 46b124968cd..2c430faaade 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java
@@ -724,6 +724,11 @@ public final UnaryCallable beginTransactio
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the
* beginning, re-using the same session.
*
+ *
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, for example, if
+ * the client job experiences a 1+ hour networking failure. At that point, Cloud Spanner has lost
+ * track of the transaction outcome and we recommend that you perform another read from the
+ * database to see the state of things as they are now.
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param transactionId Commit a previously-started transaction.
* @param mutations The mutations to be executed when this transaction commits. All mutations are
@@ -751,6 +756,11 @@ public final CommitResponse commit(
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the
* beginning, re-using the same session.
*
+ *
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, for example, if
+ * the client job experiences a 1+ hour networking failure. At that point, Cloud Spanner has lost
+ * track of the transaction outcome and we recommend that you perform another read from the
+ * database to see the state of things as they are now.
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param singleUseTransaction Execute mutations in a temporary transaction. Note that unlike
* commit of a previously-started transaction, commit with a temporary transaction is
@@ -784,6 +794,11 @@ public final CommitResponse commit(
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the
* beginning, re-using the same session.
*
+ *
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, for example, if
+ * the client job experiences a 1+ hour networking failure. At that point, Cloud Spanner has lost
+ * track of the transaction outcome and we recommend that you perform another read from the
+ * database to see the state of things as they are now.
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param transactionId Commit a previously-started transaction.
* @param mutations The mutations to be executed when this transaction commits. All mutations are
@@ -811,6 +826,11 @@ public final CommitResponse commit(
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the
* beginning, re-using the same session.
*
+ *
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, for example, if
+ * the client job experiences a 1+ hour networking failure. At that point, Cloud Spanner has lost
+ * track of the transaction outcome and we recommend that you perform another read from the
+ * database to see the state of things as they are now.
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param singleUseTransaction Execute mutations in a temporary transaction. Note that unlike
* commit of a previously-started transaction, commit with a temporary transaction is
@@ -844,6 +864,11 @@ public final CommitResponse commit(
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the
* beginning, re-using the same session.
*
+ *
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, for example, if
+ * the client job experiences a 1+ hour networking failure. At that point, Cloud Spanner has lost
+ * track of the transaction outcome and we recommend that you perform another read from the
+ * database to see the state of things as they are now.
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -861,6 +886,11 @@ public final CommitResponse commit(CommitRequest request) {
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the transaction from the
* beginning, re-using the same session.
*
+ *
On very rare occasions, `Commit` might return `UNKNOWN`. This can happen, for example, if
+ * the client job experiences a 1+ hour networking failure. At that point, Cloud Spanner has lost
+ * track of the transaction outcome and we recommend that you perform another read from the
+ * database to see the state of things as they are now.
+ *
*
Sample code:
*/
public final UnaryCallable commitCallable() {
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java
index a31cc5f2a19..0ee0e706d1f 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java
@@ -954,7 +954,10 @@ public void beginTransactionExceptionTest2() throws Exception {
@Test
public void commitTest() throws Exception {
CommitResponse expectedResponse =
- CommitResponse.newBuilder().setCommitTimestamp(Timestamp.newBuilder().build()).build();
+ CommitResponse.newBuilder()
+ .setCommitTimestamp(Timestamp.newBuilder().build())
+ .setCommitStats(CommitResponse.CommitStats.newBuilder().build())
+ .build();
mockSpanner.addResponse(expectedResponse);
SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]");
@@ -996,7 +999,10 @@ public void commitExceptionTest() throws Exception {
@Test
public void commitTest2() throws Exception {
CommitResponse expectedResponse =
- CommitResponse.newBuilder().setCommitTimestamp(Timestamp.newBuilder().build()).build();
+ CommitResponse.newBuilder()
+ .setCommitTimestamp(Timestamp.newBuilder().build())
+ .setCommitStats(CommitResponse.CommitStats.newBuilder().build())
+ .build();
mockSpanner.addResponse(expectedResponse);
SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]");
@@ -1038,7 +1044,10 @@ public void commitExceptionTest2() throws Exception {
@Test
public void commitTest3() throws Exception {
CommitResponse expectedResponse =
- CommitResponse.newBuilder().setCommitTimestamp(Timestamp.newBuilder().build()).build();
+ CommitResponse.newBuilder()
+ .setCommitTimestamp(Timestamp.newBuilder().build())
+ .setCommitStats(CommitResponse.CommitStats.newBuilder().build())
+ .build();
mockSpanner.addResponse(expectedResponse);
String session = "session1984987798";
@@ -1080,7 +1089,10 @@ public void commitExceptionTest3() throws Exception {
@Test
public void commitTest4() throws Exception {
CommitResponse expectedResponse =
- CommitResponse.newBuilder().setCommitTimestamp(Timestamp.newBuilder().build()).build();
+ CommitResponse.newBuilder()
+ .setCommitTimestamp(Timestamp.newBuilder().build())
+ .setCommitStats(CommitResponse.CommitStats.newBuilder().build())
+ .build();
mockSpanner.addResponse(expectedResponse);
String session = "session1984987798";
diff --git a/grpc-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerGrpc.java b/grpc-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerGrpc.java
index 2ea1647918f..52e4daaaf13 100644
--- a/grpc-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerGrpc.java
+++ b/grpc-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerGrpc.java
@@ -924,6 +924,11 @@ public void beginTransaction(
* transactions. However, it can also happen for a variety of other
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
* the transaction from the beginning, re-using the same session.
+ * On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
+ * for example, if the client job experiences a 1+ hour networking failure.
+ * At that point, Cloud Spanner has lost track of the transaction outcome and
+ * we recommend that you perform another read from the database to see the
+ * state of things as they are now.
*
*/
public void commit(
@@ -1357,6 +1362,11 @@ public void beginTransaction(
* transactions. However, it can also happen for a variety of other
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
* the transaction from the beginning, re-using the same session.
+ * On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
+ * for example, if the client job experiences a 1+ hour networking failure.
+ * At that point, Cloud Spanner has lost track of the transaction outcome and
+ * we recommend that you perform another read from the database to see the
+ * state of things as they are now.
*
*/
public void commit(
@@ -1663,6 +1673,11 @@ public com.google.spanner.v1.Transaction beginTransaction(
* transactions. However, it can also happen for a variety of other
* reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
* the transaction from the beginning, re-using the same session.
+ * On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
+ * for example, if the client job experiences a 1+ hour networking failure.
+ * At that point, Cloud Spanner has lost track of the transaction outcome and
+ * we recommend that you perform another read from the database to see the
+ * state of things as they are now.
*
*/
public com.google.spanner.v1.CommitResponse commit(
@@ -1932,6 +1947,11 @@ public com.google.common.util.concurrent.ListenableFuture
*/
public com.google.common.util.concurrent.ListenableFuture
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitRequest.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitRequest.java
index f322ec04c09..1ba7b235bbb 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitRequest.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitRequest.java
@@ -111,6 +111,11 @@ private CommitRequest(
input.readMessage(com.google.spanner.v1.Mutation.parser(), extensionRegistry));
break;
}
+ case 40:
+ {
+ returnCommitStats_ = input.readBool();
+ break;
+ }
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -422,6 +427,26 @@ public com.google.spanner.v1.MutationOrBuilder getMutationsOrBuilder(int index)
return mutations_.get(index);
}
+ public static final int RETURN_COMMIT_STATS_FIELD_NUMBER = 5;
+ private boolean returnCommitStats_;
+ /**
+ *
+ *
+ *
+ * If `true`, then statistics related to the transaction will be included in
+ * the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
+ * `false`.
+ *
+ * If `true`, then statistics related to the transaction will be included in
+ * the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
+ * `false`.
+ *
+ * If `true`, then statistics related to the transaction will be included in
+ * the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
+ * `false`.
+ *
+ *
+ * bool return_commit_stats = 5;
+ *
+ * @param value The returnCommitStats to set.
+ * @return This builder for chaining.
+ */
+ public Builder setReturnCommitStats(boolean value) {
+
+ returnCommitStats_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * If `true`, then statistics related to the transaction will be included in
+ * the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
+ * `false`.
+ *
+ * If `true`, then statistics related to the transaction will be included in
+ * the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
+ * `false`.
+ *
+ * The total number of mutations for the transaction. Knowing the
+ * `mutation_count` value can help you maximize the number of mutations
+ * in a transaction and minimize the number of API round trips. You can
+ * also monitor this value to prevent transactions from exceeding the system
+ * [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
+ * If the number of mutations exceeds the limit, the server returns
+ * [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
+ *
+ * The total number of mutations for the transaction. Knowing the
+ * `mutation_count` value can help you maximize the number of mutations
+ * in a transaction and minimize the number of API round trips. You can
+ * also monitor this value to prevent transactions from exceeding the system
+ * [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
+ * If the number of mutations exceeds the limit, the server returns
+ * [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
+ *
+ * The total number of mutations for the transaction. Knowing the
+ * `mutation_count` value can help you maximize the number of mutations
+ * in a transaction and minimize the number of API round trips. You can
+ * also monitor this value to prevent transactions from exceeding the system
+ * [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
+ * If the number of mutations exceeds the limit, the server returns
+ * [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
+ *
+ * The total number of mutations for the transaction. Knowing the
+ * `mutation_count` value can help you maximize the number of mutations
+ * in a transaction and minimize the number of API round trips. You can
+ * also monitor this value to prevent transactions from exceeding the system
+ * [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
+ * If the number of mutations exceeds the limit, the server returns
+ * [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
+ *
+ *
+ * int64 mutation_count = 1;
+ *
+ * @param value The mutationCount to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMutationCount(long value) {
+
+ mutationCount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The total number of mutations for the transaction. Knowing the
+ * `mutation_count` value can help you maximize the number of mutations
+ * in a transaction and minimize the number of API round trips. You can
+ * also monitor this value to prevent transactions from exceeding the system
+ * [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
+ * If the number of mutations exceeds the limit, the server returns
+ * [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
+ *
+ *
+ * int64 mutation_count = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearMutationCount() {
+
+ mutationCount_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.spanner.v1.CommitResponse.CommitStats)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.spanner.v1.CommitResponse.CommitStats)
+ private static final com.google.spanner.v1.CommitResponse.CommitStats DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.spanner.v1.CommitResponse.CommitStats();
+ }
+
+ public static com.google.spanner.v1.CommitResponse.CommitStats getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser PARSER =
+ new com.google.protobuf.AbstractParser() {
+ @java.lang.Override
+ public CommitStats parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new CommitStats(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.spanner.v1.CommitResponse.CommitStats getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+ }
+
public static final int COMMIT_TIMESTAMP_FIELD_NUMBER = 1;
private com.google.protobuf.Timestamp commitTimestamp_;
/**
@@ -165,6 +761,60 @@ public com.google.protobuf.TimestampOrBuilder getCommitTimestampOrBuilder() {
return getCommitTimestamp();
}
+ public static final int COMMIT_STATS_FIELD_NUMBER = 2;
+ private com.google.spanner.v1.CommitResponse.CommitStats commitStats_;
+ /**
+ *
+ *
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ * The statistics about this Commit. Not returned by default.
+ * For more information, see
+ * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ *
+ *
+ * .google.spanner.v1.CommitResponse.CommitStats commit_stats = 2;
+ */
+ com.google.spanner.v1.CommitResponse.CommitStatsOrBuilder getCommitStatsOrBuilder();
}
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java
index 1e757805fd5..79a7ad822b4 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java
@@ -402,6 +402,9 @@ public interface QueryOptionsOrBuilder
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -426,6 +429,9 @@ public interface QueryOptionsOrBuilder
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -546,6 +552,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -581,6 +590,9 @@ public java.lang.String getOptimizerVersion() {
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -941,6 +953,9 @@ public Builder mergeFrom(
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -975,6 +990,9 @@ public java.lang.String getOptimizerVersion() {
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -1009,6 +1027,9 @@ public com.google.protobuf.ByteString getOptimizerVersionBytes() {
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -1042,6 +1063,9 @@ public Builder setOptimizerVersion(java.lang.String value) {
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -1071,6 +1095,9 @@ public Builder clearOptimizerVersion() {
* SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
* with an invalid optimizer version will fail with a syntax error
* (`INVALID_ARGUMENT`) status.
+ * See
+ * https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ * for more information on managing the query optimizer.
* The `optimizer_version` statement hint has precedence over this setting.
*
*
@@ -1318,8 +1345,9 @@ public com.google.protobuf.ByteString getSqlBytes() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -1340,8 +1368,9 @@ public boolean hasParams() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -1362,8 +1391,9 @@ public com.google.protobuf.Struct getParams() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2656,8 +2686,9 @@ public Builder setSqlBytes(com.google.protobuf.ByteString value) {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2677,8 +2708,9 @@ public boolean hasParams() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2702,8 +2734,9 @@ public com.google.protobuf.Struct getParams() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2731,8 +2764,9 @@ public Builder setParams(com.google.protobuf.Struct value) {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2757,8 +2791,9 @@ public Builder setParams(com.google.protobuf.Struct.Builder builderForValue) {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2787,8 +2822,9 @@ public Builder mergeParams(com.google.protobuf.Struct value) {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2814,8 +2850,9 @@ public Builder clearParams() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2835,8 +2872,9 @@ public com.google.protobuf.Struct.Builder getParamsBuilder() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -2858,8 +2896,9 @@ public com.google.protobuf.StructOrBuilder getParamsOrBuilder() {
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java
index 7971beeb49c..d6af9b0ba6c 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java
@@ -136,8 +136,9 @@ public interface ExecuteSqlRequestOrBuilder
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -155,8 +156,9 @@ public interface ExecuteSqlRequestOrBuilder
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
@@ -174,8 +176,9 @@ public interface ExecuteSqlRequestOrBuilder
*
* Parameter names and values that bind to placeholders in the SQL string.
* A parameter placeholder consists of the `@` character followed by the
- * parameter name (for example, `@firstName`). Parameter names can contain
- * letters, numbers, and underscores.
+ * parameter name (for example, `@firstName`). Parameter names must conform
+ * to the naming requirements of identifiers as specified at
+ * https://cloud.google.com/spanner/docs/lexical#identifiers.
* Parameters can appear anywhere that a literal value is expected. The same
* parameter name can be used more than once, for example:
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java
index 9fe4f10c7cb..1b058eb621f 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java
@@ -170,11 +170,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) {
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The name.
*/
@@ -194,11 +193,10 @@ public java.lang.String getName() {
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for name.
*/
@@ -346,7 +344,8 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return Whether the createTime field is set.
*/
@@ -361,7 +360,8 @@ public boolean hasCreateTime() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return The createTime.
*/
@@ -376,7 +376,8 @@ public com.google.protobuf.Timestamp getCreateTime() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
@@ -393,7 +394,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return Whether the approximateLastUseTime field is set.
*/
@@ -409,7 +412,9 @@ public boolean hasApproximateLastUseTime() {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return The approximateLastUseTime.
*/
@@ -427,7 +432,9 @@ public com.google.protobuf.Timestamp getApproximateLastUseTime() {
* typically earlier than the actual last use time.
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The name.
*/
@@ -875,11 +881,10 @@ public java.lang.String getName() {
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for name.
*/
@@ -898,11 +903,10 @@ public com.google.protobuf.ByteString getNameBytes() {
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @param value The name to set.
* @return This builder for chaining.
@@ -920,11 +924,10 @@ public Builder setName(java.lang.String value) {
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return This builder for chaining.
*/
@@ -938,11 +941,10 @@ public Builder clearName() {
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @param value The bytes for name to set.
* @return This builder for chaining.
@@ -1170,7 +1172,9 @@ public Builder putAllLabels(java.util.Map va
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return Whether the createTime field is set.
*/
@@ -1184,7 +1188,9 @@ public boolean hasCreateTime() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return The createTime.
*/
@@ -1204,7 +1210,9 @@ public com.google.protobuf.Timestamp getCreateTime() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder setCreateTime(com.google.protobuf.Timestamp value) {
if (createTimeBuilder_ == null) {
@@ -1226,7 +1234,9 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (createTimeBuilder_ == null) {
@@ -1245,7 +1255,9 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
if (createTimeBuilder_ == null) {
@@ -1269,7 +1281,9 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder clearCreateTime() {
if (createTimeBuilder_ == null) {
@@ -1289,7 +1303,9 @@ public Builder clearCreateTime() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
@@ -1303,7 +1319,9 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
if (createTimeBuilder_ != null) {
@@ -1321,7 +1339,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ *
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
@@ -1354,7 +1374,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return Whether the approximateLastUseTime field is set.
*/
@@ -1369,7 +1391,9 @@ public boolean hasApproximateLastUseTime() {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return The approximateLastUseTime.
*/
@@ -1390,7 +1414,9 @@ public com.google.protobuf.Timestamp getApproximateLastUseTime() {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder setApproximateLastUseTime(com.google.protobuf.Timestamp value) {
if (approximateLastUseTimeBuilder_ == null) {
@@ -1413,7 +1439,9 @@ public Builder setApproximateLastUseTime(com.google.protobuf.Timestamp value) {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder setApproximateLastUseTime(
com.google.protobuf.Timestamp.Builder builderForValue) {
@@ -1434,7 +1462,9 @@ public Builder setApproximateLastUseTime(
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder mergeApproximateLastUseTime(com.google.protobuf.Timestamp value) {
if (approximateLastUseTimeBuilder_ == null) {
@@ -1461,7 +1491,9 @@ public Builder mergeApproximateLastUseTime(com.google.protobuf.Timestamp value)
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public Builder clearApproximateLastUseTime() {
if (approximateLastUseTimeBuilder_ == null) {
@@ -1482,7 +1514,9 @@ public Builder clearApproximateLastUseTime() {
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public com.google.protobuf.Timestamp.Builder getApproximateLastUseTimeBuilder() {
@@ -1497,7 +1531,9 @@ public com.google.protobuf.Timestamp.Builder getApproximateLastUseTimeBuilder()
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
public com.google.protobuf.TimestampOrBuilder getApproximateLastUseTimeOrBuilder() {
if (approximateLastUseTimeBuilder_ != null) {
@@ -1516,7 +1552,9 @@ public com.google.protobuf.TimestampOrBuilder getApproximateLastUseTimeOrBuilder
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java
index 6b7fc5b822a..556832d0093 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java
@@ -27,11 +27,10 @@ public interface SessionOrBuilder
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The name.
*/
@@ -40,11 +39,10 @@ public interface SessionOrBuilder
*
*
*
- * The name of the session. This is always system-assigned; values provided
- * when creating a session are ignored.
+ * Output only. The name of the session. This is always system-assigned.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for name.
*/
@@ -141,7 +139,8 @@ public interface SessionOrBuilder
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return Whether the createTime field is set.
*/
@@ -153,7 +152,8 @@ public interface SessionOrBuilder
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return The createTime.
*/
@@ -165,7 +165,8 @@ public interface SessionOrBuilder
* Output only. The timestamp when the session is created.
*
*
- * .google.protobuf.Timestamp create_time = 3;
+ * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();
@@ -177,7 +178,9 @@ public interface SessionOrBuilder
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return Whether the approximateLastUseTime field is set.
*/
@@ -190,7 +193,9 @@ public interface SessionOrBuilder
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*
* @return The approximateLastUseTime.
*/
@@ -203,7 +208,9 @@ public interface SessionOrBuilder
* typically earlier than the actual last use time.
*
*
- * .google.protobuf.Timestamp approximate_last_use_time = 4;
+ *
+ * .google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
*/
com.google.protobuf.TimestampOrBuilder getApproximateLastUseTimeOrBuilder();
}
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
index 0932ab5d52a..8458063adac 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
@@ -131,6 +131,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
internal_static_google_spanner_v1_CommitResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_spanner_v1_CommitResponse_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_spanner_v1_CommitResponse_CommitStats_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_spanner_v1_CommitResponse_CommitStats_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_spanner_v1_RollbackRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
@@ -148,198 +152,202 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "e.spanner.v1\032\034google/api/annotations.pro"
+ "to\032\027google/api/client.proto\032\037google/api/"
+ "field_behavior.proto\032\031google/api/resourc"
- + "e.proto\032\033google/protobuf/empty.proto\032\034go"
- + "ogle/protobuf/struct.proto\032\037google/proto"
- + "buf/timestamp.proto\032\027google/rpc/status.p"
- + "roto\032\034google/spanner/v1/keys.proto\032 goog"
- + "le/spanner/v1/mutation.proto\032\"google/spa"
- + "nner/v1/result_set.proto\032#google/spanner"
- + "/v1/transaction.proto\032\034google/spanner/v1"
- + "/type.proto\"~\n\024CreateSessionRequest\0229\n\010d"
- + "atabase\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapi"
- + "s.com/Database\022+\n\007session\030\002 \001(\0132\032.google"
- + ".spanner.v1.Session\"\251\001\n\032BatchCreateSessi"
- + "onsRequest\0229\n\010database\030\001 \001(\tB\'\340A\002\372A!\n\037sp"
- + "anner.googleapis.com/Database\0224\n\020session"
- + "_template\030\002 \001(\0132\032.google.spanner.v1.Sess"
- + "ion\022\032\n\rsession_count\030\003 \001(\005B\003\340A\002\"J\n\033Batch"
- + "CreateSessionsResponse\022+\n\007session\030\001 \003(\0132"
- + "\032.google.spanner.v1.Session\"\344\002\n\007Session\022"
- + "\014\n\004name\030\001 \001(\t\0226\n\006labels\030\002 \003(\0132&.google.s"
- + "panner.v1.Session.LabelsEntry\022/\n\013create_"
- + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022="
- + "\n\031approximate_last_use_time\030\004 \001(\0132\032.goog"
- + "le.protobuf.Timestamp\032-\n\013LabelsEntry\022\013\n\003"
- + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:t\352Aq\n\036spann"
- + "er.googleapis.com/Session\022Oprojects/{pro"
- + "ject}/instances/{instance}/databases/{da"
- + "tabase}/sessions/{session}\"I\n\021GetSession"
- + "Request\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036spanner.g"
- + "oogleapis.com/Session\"\207\001\n\023ListSessionsRe"
- + "quest\0229\n\010database\030\001 \001(\tB\'\340A\002\372A!\n\037spanner"
- + ".googleapis.com/Database\022\021\n\tpage_size\030\002 "
- + "\001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\""
- + "]\n\024ListSessionsResponse\022,\n\010sessions\030\001 \003("
- + "\0132\032.google.spanner.v1.Session\022\027\n\017next_pa"
- + "ge_token\030\002 \001(\t\"L\n\024DeleteSessionRequest\0224"
- + "\n\004name\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapis"
- + ".com/Session\"\202\005\n\021ExecuteSqlRequest\0227\n\007se"
- + "ssion\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapis."
- + "com/Session\022;\n\013transaction\030\002 \001(\0132&.googl"
- + "e.spanner.v1.TransactionSelector\022\020\n\003sql\030"
- + "\003 \001(\tB\003\340A\002\022\'\n\006params\030\004 \001(\0132\027.google.prot"
- + "obuf.Struct\022I\n\013param_types\030\005 \003(\01324.googl"
- + "e.spanner.v1.ExecuteSqlRequest.ParamType"
- + "sEntry\022\024\n\014resume_token\030\006 \001(\014\022B\n\nquery_mo"
- + "de\030\007 \001(\0162..google.spanner.v1.ExecuteSqlR"
- + "equest.QueryMode\022\027\n\017partition_token\030\010 \001("
- + "\014\022\r\n\005seqno\030\t \001(\003\022H\n\rquery_options\030\n \001(\0132"
- + "1.google.spanner.v1.ExecuteSqlRequest.Qu"
- + "eryOptions\032)\n\014QueryOptions\022\031\n\021optimizer_"
- + "version\030\001 \001(\t\032J\n\017ParamTypesEntry\022\013\n\003key\030"
- + "\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.google.spanner.v1"
- + ".Type:\0028\001\".\n\tQueryMode\022\n\n\006NORMAL\020\000\022\010\n\004PL"
- + "AN\020\001\022\013\n\007PROFILE\020\002\"\337\003\n\026ExecuteBatchDmlReq"
- + "uest\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036spanner.g"
- + "oogleapis.com/Session\022@\n\013transaction\030\002 \001"
- + "(\0132&.google.spanner.v1.TransactionSelect"
- + "orB\003\340A\002\022L\n\nstatements\030\003 \003(\01323.google.spa"
- + "nner.v1.ExecuteBatchDmlRequest.Statement"
- + "B\003\340A\002\022\022\n\005seqno\030\004 \001(\003B\003\340A\002\032\347\001\n\tStatement\022"
- + "\013\n\003sql\030\001 \001(\t\022\'\n\006params\030\002 \001(\0132\027.google.pr"
- + "otobuf.Struct\022X\n\013param_types\030\003 \003(\0132C.goo"
+ + "e.proto\032\036google/protobuf/duration.proto\032"
+ + "\033google/protobuf/empty.proto\032\034google/pro"
+ + "tobuf/struct.proto\032\037google/protobuf/time"
+ + "stamp.proto\032\027google/rpc/status.proto\032\034go"
+ + "ogle/spanner/v1/keys.proto\032 google/spann"
+ + "er/v1/mutation.proto\032\"google/spanner/v1/"
+ + "result_set.proto\032#google/spanner/v1/tran"
+ + "saction.proto\032\034google/spanner/v1/type.pr"
+ + "oto\"~\n\024CreateSessionRequest\0229\n\010database\030"
+ + "\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.com/Da"
+ + "tabase\022+\n\007session\030\002 \001(\0132\032.google.spanner"
+ + ".v1.Session\"\251\001\n\032BatchCreateSessionsReque"
+ + "st\0229\n\010database\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.go"
+ + "ogleapis.com/Database\0224\n\020session_templat"
+ + "e\030\002 \001(\0132\032.google.spanner.v1.Session\022\032\n\rs"
+ + "ession_count\030\003 \001(\005B\003\340A\002\"J\n\033BatchCreateSe"
+ + "ssionsResponse\022+\n\007session\030\001 \003(\0132\032.google"
+ + ".spanner.v1.Session\"\363\002\n\007Session\022\021\n\004name\030"
+ + "\001 \001(\tB\003\340A\003\0226\n\006labels\030\002 \003(\0132&.google.span"
+ + "ner.v1.Session.LabelsEntry\0224\n\013create_tim"
+ + "e\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003"
+ + "\022B\n\031approximate_last_use_time\030\004 \001(\0132\032.go"
+ + "ogle.protobuf.TimestampB\003\340A\003\032-\n\013LabelsEn"
+ + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:t\352Aq"
+ + "\n\036spanner.googleapis.com/Session\022Oprojec"
+ + "ts/{project}/instances/{instance}/databa"
+ + "ses/{database}/sessions/{session}\"I\n\021Get"
+ + "SessionRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036sp"
+ + "anner.googleapis.com/Session\"\207\001\n\023ListSes"
+ + "sionsRequest\0229\n\010database\030\001 \001(\tB\'\340A\002\372A!\n\037"
+ + "spanner.googleapis.com/Database\022\021\n\tpage_"
+ + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter"
+ + "\030\004 \001(\t\"]\n\024ListSessionsResponse\022,\n\010sessio"
+ + "ns\030\001 \003(\0132\032.google.spanner.v1.Session\022\027\n\017"
+ + "next_page_token\030\002 \001(\t\"L\n\024DeleteSessionRe"
+ + "quest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036spanner.goo"
+ + "gleapis.com/Session\"\202\005\n\021ExecuteSqlReques"
+ + "t\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036spanner.goog"
+ + "leapis.com/Session\022;\n\013transaction\030\002 \001(\0132"
+ + "&.google.spanner.v1.TransactionSelector\022"
+ + "\020\n\003sql\030\003 \001(\tB\003\340A\002\022\'\n\006params\030\004 \001(\0132\027.goog"
+ + "le.protobuf.Struct\022I\n\013param_types\030\005 \003(\0132"
+ + "4.google.spanner.v1.ExecuteSqlRequest.Pa"
+ + "ramTypesEntry\022\024\n\014resume_token\030\006 \001(\014\022B\n\nq"
+ + "uery_mode\030\007 \001(\0162..google.spanner.v1.Exec"
+ + "uteSqlRequest.QueryMode\022\027\n\017partition_tok"
+ + "en\030\010 \001(\014\022\r\n\005seqno\030\t \001(\003\022H\n\rquery_options"
+ + "\030\n \001(\01321.google.spanner.v1.ExecuteSqlReq"
+ + "uest.QueryOptions\032)\n\014QueryOptions\022\031\n\021opt"
+ + "imizer_version\030\001 \001(\t\032J\n\017ParamTypesEntry\022"
+ + "\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.google.spa"
+ + "nner.v1.Type:\0028\001\".\n\tQueryMode\022\n\n\006NORMAL\020"
+ + "\000\022\010\n\004PLAN\020\001\022\013\n\007PROFILE\020\002\"\337\003\n\026ExecuteBatc"
+ + "hDmlRequest\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036sp"
+ + "anner.googleapis.com/Session\022@\n\013transact"
+ + "ion\030\002 \001(\0132&.google.spanner.v1.Transactio"
+ + "nSelectorB\003\340A\002\022L\n\nstatements\030\003 \003(\01323.goo"
+ "gle.spanner.v1.ExecuteBatchDmlRequest.St"
- + "atement.ParamTypesEntry\032J\n\017ParamTypesEnt"
- + "ry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.google."
- + "spanner.v1.Type:\0028\001\"p\n\027ExecuteBatchDmlRe"
- + "sponse\0221\n\013result_sets\030\001 \003(\0132\034.google.spa"
- + "nner.v1.ResultSet\022\"\n\006status\030\002 \001(\0132\022.goog"
- + "le.rpc.Status\"H\n\020PartitionOptions\022\034\n\024par"
- + "tition_size_bytes\030\001 \001(\003\022\026\n\016max_partition"
- + "s\030\002 \001(\003\"\243\003\n\025PartitionQueryRequest\0227\n\007ses"
- + "sion\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapis.c"
- + "om/Session\022;\n\013transaction\030\002 \001(\0132&.google"
- + ".spanner.v1.TransactionSelector\022\020\n\003sql\030\003"
- + " \001(\tB\003\340A\002\022\'\n\006params\030\004 \001(\0132\027.google.proto"
- + "buf.Struct\022M\n\013param_types\030\005 \003(\01328.google"
- + ".spanner.v1.PartitionQueryRequest.ParamT"
- + "ypesEntry\022>\n\021partition_options\030\006 \001(\0132#.g"
- + "oogle.spanner.v1.PartitionOptions\032J\n\017Par"
- + "amTypesEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\013"
- + "2\027.google.spanner.v1.Type:\0028\001\"\261\002\n\024Partit"
- + "ionReadRequest\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n"
- + "\036spanner.googleapis.com/Session\022;\n\013trans"
- + "action\030\002 \001(\0132&.google.spanner.v1.Transac"
- + "tionSelector\022\022\n\005table\030\003 \001(\tB\003\340A\002\022\r\n\005inde"
- + "x\030\004 \001(\t\022\017\n\007columns\030\005 \003(\t\022/\n\007key_set\030\006 \001("
- + "\0132\031.google.spanner.v1.KeySetB\003\340A\002\022>\n\021par"
- + "tition_options\030\t \001(\0132#.google.spanner.v1"
- + ".PartitionOptions\"$\n\tPartition\022\027\n\017partit"
- + "ion_token\030\001 \001(\014\"z\n\021PartitionResponse\0220\n\n"
- + "partitions\030\001 \003(\0132\034.google.spanner.v1.Par"
- + "tition\0223\n\013transaction\030\002 \001(\0132\036.google.spa"
- + "nner.v1.Transaction\"\253\002\n\013ReadRequest\0227\n\007s"
- + "ession\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapis"
- + ".com/Session\022;\n\013transaction\030\002 \001(\0132&.goog"
- + "le.spanner.v1.TransactionSelector\022\022\n\005tab"
- + "le\030\003 \001(\tB\003\340A\002\022\r\n\005index\030\004 \001(\t\022\024\n\007columns\030"
- + "\005 \003(\tB\003\340A\002\022/\n\007key_set\030\006 \001(\0132\031.google.spa"
- + "nner.v1.KeySetB\003\340A\002\022\r\n\005limit\030\010 \001(\003\022\024\n\014re"
- + "sume_token\030\t \001(\014\022\027\n\017partition_token\030\n \001("
- + "\014\"\217\001\n\027BeginTransactionRequest\0227\n\007session"
- + "\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapis.com/S"
- + "ession\022;\n\007options\030\002 \001(\0132%.google.spanner"
- + ".v1.TransactionOptionsB\003\340A\002\"\352\001\n\rCommitRe"
- + "quest\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036spanner."
- + "googleapis.com/Session\022\030\n\016transaction_id"
- + "\030\002 \001(\014H\000\022G\n\026single_use_transaction\030\003 \001(\013"
- + "2%.google.spanner.v1.TransactionOptionsH"
- + "\000\022.\n\tmutations\030\004 \003(\0132\033.google.spanner.v1"
- + ".MutationB\r\n\013transaction\"F\n\016CommitRespon"
- + "se\0224\n\020commit_timestamp\030\001 \001(\0132\032.google.pr"
- + "otobuf.Timestamp\"g\n\017RollbackRequest\0227\n\007s"
- + "ession\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapis"
- + ".com/Session\022\033\n\016transaction_id\030\002 \001(\014B\003\340A"
- + "\0022\300\026\n\007Spanner\022\246\001\n\rCreateSession\022\'.google"
- + ".spanner.v1.CreateSessionRequest\032\032.googl"
- + "e.spanner.v1.Session\"P\202\323\344\223\002?\":/v1/{datab"
- + "ase=projects/*/instances/*/databases/*}/"
- + "sessions:\001*\332A\010database\022\340\001\n\023BatchCreateSe"
- + "ssions\022-.google.spanner.v1.BatchCreateSe"
- + "ssionsRequest\032..google.spanner.v1.BatchC"
- + "reateSessionsResponse\"j\202\323\344\223\002K\"F/v1/{data"
- + "base=projects/*/instances/*/databases/*}"
- + "/sessions:batchCreate:\001*\332A\026database,sess"
- + "ion_count\022\227\001\n\nGetSession\022$.google.spanne"
- + "r.v1.GetSessionRequest\032\032.google.spanner."
- + "v1.Session\"G\202\323\344\223\002:\0228/v1/{name=projects/*"
- + "/instances/*/databases/*/sessions/*}\332A\004n"
- + "ame\022\256\001\n\014ListSessions\022&.google.spanner.v1"
- + ".ListSessionsRequest\032\'.google.spanner.v1"
- + ".ListSessionsResponse\"M\202\323\344\223\002<\022:/v1/{data"
- + "base=projects/*/instances/*/databases/*}"
- + "/sessions\332A\010database\022\231\001\n\rDeleteSession\022\'"
- + ".google.spanner.v1.DeleteSessionRequest\032"
- + "\026.google.protobuf.Empty\"G\202\323\344\223\002:*8/v1/{na"
- + "me=projects/*/instances/*/databases/*/se"
- + "ssions/*}\332A\004name\022\243\001\n\nExecuteSql\022$.google"
- + ".spanner.v1.ExecuteSqlRequest\032\034.google.s"
- + "panner.v1.ResultSet\"Q\202\323\344\223\002K\"F/v1/{sessio"
- + "n=projects/*/instances/*/databases/*/ses"
- + "sions/*}:executeSql:\001*\022\276\001\n\023ExecuteStream"
- + "ingSql\022$.google.spanner.v1.ExecuteSqlReq"
- + "uest\032#.google.spanner.v1.PartialResultSe"
- + "t\"Z\202\323\344\223\002T\"O/v1/{session=projects/*/insta"
- + "nces/*/databases/*/sessions/*}:executeSt"
- + "reamingSql:\001*0\001\022\300\001\n\017ExecuteBatchDml\022).go"
- + "ogle.spanner.v1.ExecuteBatchDmlRequest\032*"
- + ".google.spanner.v1.ExecuteBatchDmlRespon"
- + "se\"V\202\323\344\223\002P\"K/v1/{session=projects/*/inst"
- + "ances/*/databases/*/sessions/*}:executeB"
- + "atchDml:\001*\022\221\001\n\004Read\022\036.google.spanner.v1."
- + "ReadRequest\032\034.google.spanner.v1.ResultSe"
- + "t\"K\202\323\344\223\002E\"@/v1/{session=projects/*/insta"
- + "nces/*/databases/*/sessions/*}:read:\001*\022\254"
- + "\001\n\rStreamingRead\022\036.google.spanner.v1.Rea"
- + "dRequest\032#.google.spanner.v1.PartialResu"
- + "ltSet\"T\202\323\344\223\002N\"I/v1/{session=projects/*/i"
- + "nstances/*/databases/*/sessions/*}:strea"
- + "mingRead:\001*0\001\022\311\001\n\020BeginTransaction\022*.goo"
- + "gle.spanner.v1.BeginTransactionRequest\032\036"
- + ".google.spanner.v1.Transaction\"i\202\323\344\223\002Q\"L"
+ + "atementB\003\340A\002\022\022\n\005seqno\030\004 \001(\003B\003\340A\002\032\347\001\n\tSta"
+ + "tement\022\013\n\003sql\030\001 \001(\t\022\'\n\006params\030\002 \001(\0132\027.go"
+ + "ogle.protobuf.Struct\022X\n\013param_types\030\003 \003("
+ + "\0132C.google.spanner.v1.ExecuteBatchDmlReq"
+ + "uest.Statement.ParamTypesEntry\032J\n\017ParamT"
+ + "ypesEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027."
+ + "google.spanner.v1.Type:\0028\001\"p\n\027ExecuteBat"
+ + "chDmlResponse\0221\n\013result_sets\030\001 \003(\0132\034.goo"
+ + "gle.spanner.v1.ResultSet\022\"\n\006status\030\002 \001(\013"
+ + "2\022.google.rpc.Status\"H\n\020PartitionOptions"
+ + "\022\034\n\024partition_size_bytes\030\001 \001(\003\022\026\n\016max_pa"
+ + "rtitions\030\002 \001(\003\"\243\003\n\025PartitionQueryRequest"
+ + "\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036spanner.googl"
+ + "eapis.com/Session\022;\n\013transaction\030\002 \001(\0132&"
+ + ".google.spanner.v1.TransactionSelector\022\020"
+ + "\n\003sql\030\003 \001(\tB\003\340A\002\022\'\n\006params\030\004 \001(\0132\027.googl"
+ + "e.protobuf.Struct\022M\n\013param_types\030\005 \003(\01328"
+ + ".google.spanner.v1.PartitionQueryRequest"
+ + ".ParamTypesEntry\022>\n\021partition_options\030\006 "
+ + "\001(\0132#.google.spanner.v1.PartitionOptions"
+ + "\032J\n\017ParamTypesEntry\022\013\n\003key\030\001 \001(\t\022&\n\005valu"
+ + "e\030\002 \001(\0132\027.google.spanner.v1.Type:\0028\001\"\261\002\n"
+ + "\024PartitionReadRequest\0227\n\007session\030\001 \001(\tB&"
+ + "\340A\002\372A \n\036spanner.googleapis.com/Session\022;"
+ + "\n\013transaction\030\002 \001(\0132&.google.spanner.v1."
+ + "TransactionSelector\022\022\n\005table\030\003 \001(\tB\003\340A\002\022"
+ + "\r\n\005index\030\004 \001(\t\022\017\n\007columns\030\005 \003(\t\022/\n\007key_s"
+ + "et\030\006 \001(\0132\031.google.spanner.v1.KeySetB\003\340A\002"
+ + "\022>\n\021partition_options\030\t \001(\0132#.google.spa"
+ + "nner.v1.PartitionOptions\"$\n\tPartition\022\027\n"
+ + "\017partition_token\030\001 \001(\014\"z\n\021PartitionRespo"
+ + "nse\0220\n\npartitions\030\001 \003(\0132\034.google.spanner"
+ + ".v1.Partition\0223\n\013transaction\030\002 \001(\0132\036.goo"
+ + "gle.spanner.v1.Transaction\"\253\002\n\013ReadReque"
+ + "st\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036spanner.goo"
+ + "gleapis.com/Session\022;\n\013transaction\030\002 \001(\013"
+ + "2&.google.spanner.v1.TransactionSelector"
+ + "\022\022\n\005table\030\003 \001(\tB\003\340A\002\022\r\n\005index\030\004 \001(\t\022\024\n\007c"
+ + "olumns\030\005 \003(\tB\003\340A\002\022/\n\007key_set\030\006 \001(\0132\031.goo"
+ + "gle.spanner.v1.KeySetB\003\340A\002\022\r\n\005limit\030\010 \001("
+ + "\003\022\024\n\014resume_token\030\t \001(\014\022\027\n\017partition_tok"
+ + "en\030\n \001(\014\"\217\001\n\027BeginTransactionRequest\0227\n\007"
+ + "session\030\001 \001(\tB&\340A\002\372A \n\036spanner.googleapi"
+ + "s.com/Session\022;\n\007options\030\002 \001(\0132%.google."
+ + "spanner.v1.TransactionOptionsB\003\340A\002\"\207\002\n\rC"
+ + "ommitRequest\0227\n\007session\030\001 \001(\tB&\340A\002\372A \n\036s"
+ + "panner.googleapis.com/Session\022\030\n\016transac"
+ + "tion_id\030\002 \001(\014H\000\022G\n\026single_use_transactio"
+ + "n\030\003 \001(\0132%.google.spanner.v1.TransactionO"
+ + "ptionsH\000\022.\n\tmutations\030\004 \003(\0132\033.google.spa"
+ + "nner.v1.Mutation\022\033\n\023return_commit_stats\030"
+ + "\005 \001(\010B\r\n\013transaction\"\262\001\n\016CommitResponse\022"
+ + "4\n\020commit_timestamp\030\001 \001(\0132\032.google.proto"
+ + "buf.Timestamp\022C\n\014commit_stats\030\002 \001(\0132-.go"
+ + "ogle.spanner.v1.CommitResponse.CommitSta"
+ + "ts\032%\n\013CommitStats\022\026\n\016mutation_count\030\001 \001("
+ + "\003\"g\n\017RollbackRequest\0227\n\007session\030\001 \001(\tB&\340"
+ + "A\002\372A \n\036spanner.googleapis.com/Session\022\033\n"
+ + "\016transaction_id\030\002 \001(\014B\003\340A\0022\300\026\n\007Spanner\022\246"
+ + "\001\n\rCreateSession\022\'.google.spanner.v1.Cre"
+ + "ateSessionRequest\032\032.google.spanner.v1.Se"
+ + "ssion\"P\202\323\344\223\002?\":/v1/{database=projects/*/"
+ + "instances/*/databases/*}/sessions:\001*\332A\010d"
+ + "atabase\022\340\001\n\023BatchCreateSessions\022-.google"
+ + ".spanner.v1.BatchCreateSessionsRequest\032."
+ + ".google.spanner.v1.BatchCreateSessionsRe"
+ + "sponse\"j\202\323\344\223\002K\"F/v1/{database=projects/*"
+ + "/instances/*/databases/*}/sessions:batch"
+ + "Create:\001*\332A\026database,session_count\022\227\001\n\nG"
+ + "etSession\022$.google.spanner.v1.GetSession"
+ + "Request\032\032.google.spanner.v1.Session\"G\202\323\344"
+ + "\223\002:\0228/v1/{name=projects/*/instances/*/da"
+ + "tabases/*/sessions/*}\332A\004name\022\256\001\n\014ListSes"
+ + "sions\022&.google.spanner.v1.ListSessionsRe"
+ + "quest\032\'.google.spanner.v1.ListSessionsRe"
+ + "sponse\"M\202\323\344\223\002<\022:/v1/{database=projects/*"
+ + "/instances/*/databases/*}/sessions\332A\010dat"
+ + "abase\022\231\001\n\rDeleteSession\022\'.google.spanner"
+ + ".v1.DeleteSessionRequest\032\026.google.protob"
+ + "uf.Empty\"G\202\323\344\223\002:*8/v1/{name=projects/*/i"
+ + "nstances/*/databases/*/sessions/*}\332A\004nam"
+ + "e\022\243\001\n\nExecuteSql\022$.google.spanner.v1.Exe"
+ + "cuteSqlRequest\032\034.google.spanner.v1.Resul"
+ + "tSet\"Q\202\323\344\223\002K\"F/v1/{session=projects/*/in"
+ + "stances/*/databases/*/sessions/*}:execut"
+ + "eSql:\001*\022\276\001\n\023ExecuteStreamingSql\022$.google"
+ + ".spanner.v1.ExecuteSqlRequest\032#.google.s"
+ + "panner.v1.PartialResultSet\"Z\202\323\344\223\002T\"O/v1/"
+ + "{session=projects/*/instances/*/database"
+ + "s/*/sessions/*}:executeStreamingSql:\001*0\001"
+ + "\022\300\001\n\017ExecuteBatchDml\022).google.spanner.v1"
+ + ".ExecuteBatchDmlRequest\032*.google.spanner"
+ + ".v1.ExecuteBatchDmlResponse\"V\202\323\344\223\002P\"K/v1"
+ + "/{session=projects/*/instances/*/databas"
+ + "es/*/sessions/*}:executeBatchDml:\001*\022\221\001\n\004"
+ + "Read\022\036.google.spanner.v1.ReadRequest\032\034.g"
+ + "oogle.spanner.v1.ResultSet\"K\202\323\344\223\002E\"@/v1/"
+ + "{session=projects/*/instances/*/database"
+ + "s/*/sessions/*}:read:\001*\022\254\001\n\rStreamingRea"
+ + "d\022\036.google.spanner.v1.ReadRequest\032#.goog"
+ + "le.spanner.v1.PartialResultSet\"T\202\323\344\223\002N\"I"
+ "/v1/{session=projects/*/instances/*/data"
- + "bases/*/sessions/*}:beginTransaction:\001*\332"
- + "A\017session,options\022\353\001\n\006Commit\022 .google.sp"
- + "anner.v1.CommitRequest\032!.google.spanner."
- + "v1.CommitResponse\"\233\001\202\323\344\223\002G\"B/v1/{session"
- + "=projects/*/instances/*/databases/*/sess"
- + "ions/*}:commit:\001*\332A session,transaction_"
- + "id,mutations\332A(session,single_use_transa"
- + "ction,mutations\022\260\001\n\010Rollback\022\".google.sp"
- + "anner.v1.RollbackRequest\032\026.google.protob"
- + "uf.Empty\"h\202\323\344\223\002I\"D/v1/{session=projects/"
- + "*/instances/*/databases/*/sessions/*}:ro"
- + "llback:\001*\332A\026session,transaction_id\022\267\001\n\016P"
- + "artitionQuery\022(.google.spanner.v1.Partit"
- + "ionQueryRequest\032$.google.spanner.v1.Part"
- + "itionResponse\"U\202\323\344\223\002O\"J/v1/{session=proj"
- + "ects/*/instances/*/databases/*/sessions/"
- + "*}:partitionQuery:\001*\022\264\001\n\rPartitionRead\022\'"
- + ".google.spanner.v1.PartitionReadRequest\032"
- + "$.google.spanner.v1.PartitionResponse\"T\202"
- + "\323\344\223\002N\"I/v1/{session=projects/*/instances"
- + "/*/databases/*/sessions/*}:partitionRead"
- + ":\001*\032w\312A\026spanner.googleapis.com\322A[https:/"
- + "/www.googleapis.com/auth/cloud-platform,"
- + "https://www.googleapis.com/auth/spanner."
- + "dataB\224\002\n\025com.google.spanner.v1B\014SpannerP"
- + "rotoP\001Z8google.golang.org/genproto/googl"
- + "eapis/spanner/v1;spanner\252\002\027Google.Cloud."
- + "Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1\352\002\032G"
- + "oogle::Cloud::Spanner::V1\352A_\n\037spanner.go"
- + "ogleapis.com/Database\022
@@ -148,7 +148,7 @@ public interface FieldOrBuilder
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -311,7 +311,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -340,7 +340,7 @@ public java.lang.String getName() {
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -764,7 +764,7 @@ public Builder mergeFrom(
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -792,7 +792,7 @@ public java.lang.String getName() {
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -820,7 +820,7 @@ public com.google.protobuf.ByteString getNameBytes() {
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -847,7 +847,7 @@ public Builder setName(java.lang.String value) {
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
@@ -870,7 +870,7 @@ public Builder clearName() {
* SQL queries, it is the column alias (e.g., `"Word"` in the
* query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
* `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- * columns might have an empty name (e.g., !"SELECT
+ * columns might have an empty name (e.g., `"SELECT
* UPPER(ColName)"`). Note that a query result can contain
* multiple fields with the same name.
*
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java
index 93de3f1b96a..980f749f00a 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java
@@ -23,10 +23,11 @@
*
*
* # Transactions
- * Each session can have at most one active transaction at a time. After the
- * active transaction is completed, the session can immediately be
- * re-used for the next transaction. It is not necessary to create a
- * new session for each transaction.
+ * Each session can have at most one active transaction at a time (note that
+ * standalone reads and queries use a transaction internally and do count
+ * towards the one transaction limit). After the active transaction is
+ * completed, the session can immediately be re-used for the next transaction.
+ * It is not necessary to create a new session for each transaction.
* # Transaction Modes
* Cloud Spanner supports three transaction modes:
* 1. Locking read-write. This type of transaction is the only way
@@ -4312,10 +4313,11 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* # Transactions
- * Each session can have at most one active transaction at a time. After the
- * active transaction is completed, the session can immediately be
- * re-used for the next transaction. It is not necessary to create a
- * new session for each transaction.
+ * Each session can have at most one active transaction at a time (note that
+ * standalone reads and queries use a transaction internally and do count
+ * towards the one transaction limit). After the active transaction is
+ * completed, the session can immediately be re-used for the next transaction.
+ * It is not necessary to create a new session for each transaction.
* # Transaction Modes
* Cloud Spanner supports three transaction modes:
* 1. Locking read-write. This type of transaction is the only way
diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto
index 93e4987ed16..8f579e333d3 100644
--- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto
+++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
+import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
@@ -219,6 +220,12 @@ service Spanner {
// transactions. However, it can also happen for a variety of other
// reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
// the transaction from the beginning, re-using the same session.
+ //
+ // On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
+ // for example, if the client job experiences a 1+ hour networking failure.
+ // At that point, Cloud Spanner has lost track of the transaction outcome and
+ // we recommend that you perform another read from the database to see the
+ // state of things as they are now.
rpc Commit(CommitRequest) returns (CommitResponse) {
option (google.api.http) = {
post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:commit"
@@ -331,9 +338,8 @@ message Session {
pattern: "projects/{project}/instances/{instance}/databases/{database}/sessions/{session}"
};
- // The name of the session. This is always system-assigned; values provided
- // when creating a session are ignored.
- string name = 1;
+ // Output only. The name of the session. This is always system-assigned.
+ string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The labels for the session.
//
@@ -347,11 +353,11 @@ message Session {
map labels = 2;
// Output only. The timestamp when the session is created.
- google.protobuf.Timestamp create_time = 3;
+ google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The approximate timestamp when the session is last used. It is
// typically earlier than the actual last use time.
- google.protobuf.Timestamp approximate_last_use_time = 4;
+ google.protobuf.Timestamp approximate_last_use_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
@@ -438,6 +444,9 @@ message ExecuteSqlRequest {
// SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement
// with an invalid optimizer version will fail with a syntax error
// (`INVALID_ARGUMENT`) status.
+ // See
+ // https://cloud.google.com/spanner/docs/query-optimizer/manage-query-optimizer
+ // for more information on managing the query optimizer.
//
// The `optimizer_version` statement hint has precedence over this setting.
string optimizer_version = 1;
@@ -483,8 +492,9 @@ message ExecuteSqlRequest {
// Parameter names and values that bind to placeholders in the SQL string.
//
// A parameter placeholder consists of the `@` character followed by the
- // parameter name (for example, `@firstName`). Parameter names can contain
- // letters, numbers, and underscores.
+ // parameter name (for example, `@firstName`). Parameter names must conform
+ // to the naming requirements of identifiers as specified at
+ // https://cloud.google.com/spanner/docs/lexical#identifiers.
//
// Parameters can appear anywhere that a literal value is expected. The same
// parameter name can be used more than once, for example:
@@ -884,12 +894,34 @@ message CommitRequest {
// mutations are applied atomically, in the order they appear in
// this list.
repeated Mutation mutations = 4;
+
+ // If `true`, then statistics related to the transaction will be included in
+ // the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is
+ // `false`.
+ bool return_commit_stats = 5;
}
// The response for [Commit][google.spanner.v1.Spanner.Commit].
message CommitResponse {
+ // Additional statistics about a commit.
+ message CommitStats {
+ // The total number of mutations for the transaction. Knowing the
+ // `mutation_count` value can help you maximize the number of mutations
+ // in a transaction and minimize the number of API round trips. You can
+ // also monitor this value to prevent transactions from exceeding the system
+ // [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
+ // If the number of mutations exceeds the limit, the server returns
+ // [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
+ int64 mutation_count = 1;
+ }
+
// The Cloud Spanner timestamp at which the transaction committed.
google.protobuf.Timestamp commit_timestamp = 1;
+
+ // The statistics about this Commit. Not returned by default.
+ // For more information, see
+ // [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
+ CommitStats commit_stats = 2;
}
// The request for [Rollback][google.spanner.v1.Spanner.Rollback].
diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto
index 0bcbfcf9002..2cafefcb107 100644
--- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto
+++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto
@@ -31,10 +31,11 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// # Transactions
//
//
-// Each session can have at most one active transaction at a time. After the
-// active transaction is completed, the session can immediately be
-// re-used for the next transaction. It is not necessary to create a
-// new session for each transaction.
+// Each session can have at most one active transaction at a time (note that
+// standalone reads and queries use a transaction internally and do count
+// towards the one transaction limit). After the active transaction is
+// completed, the session can immediately be re-used for the next transaction.
+// It is not necessary to create a new session for each transaction.
//
// # Transaction Modes
//
diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto
index 1e5e5ff313a..1b863c0fdf4 100644
--- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto
+++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto
@@ -50,7 +50,7 @@ message StructType {
// SQL queries, it is the column alias (e.g., `"Word"` in the
// query `"SELECT 'hello' AS Word"`), or the column name (e.g.,
// `"ColName"` in the query `"SELECT ColName FROM Table"`). Some
- // columns might have an empty name (e.g., !"SELECT
+ // columns might have an empty name (e.g., `"SELECT
// UPPER(ColName)"`). Note that a query result can contain
// multiple fields with the same name.
string name = 1;
diff --git a/synth.metadata b/synth.metadata
index 0a947958495..554bb0a42ca 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "15052653993a3924037b2c4ba27e04f553493885"
+ "sha": "4aa770ce669404ad0eca542ae5bd32a421748c18"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
- "internalRef": "350949863"
+ "sha": "8fa381b7138f1d72966ff20563efae1b2194d359",
+ "internalRef": "353145174"
}
},
{
From 2f1450cb4780590d6660ebae56f96331b78dd973 Mon Sep 17 00:00:00 2001
From: Thiago Nunes
Date: Mon, 25 Jan 2021 10:25:03 +1100
Subject: [PATCH 06/42] chore: warns of transactions bug (#815)
* chore: warns of transactions bug
Happening in versions >= 3.0.0 and <= 3.3.1
* chore: fix phrasing
---
CHANGELOG.md | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 126 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6df923a9d96..9bb95f58712 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,15 @@
### [3.3.1](https://www.github.com/googleapis/java-spanner/compare/v3.3.0...v3.3.1) (2021-01-14)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Bug Fixes
@@ -31,6 +40,15 @@
## [3.3.0](https://www.github.com/googleapis/java-spanner/compare/v3.2.1...v3.3.0) (2021-01-07)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Features
@@ -43,6 +61,15 @@
### [3.2.1](https://www.github.com/googleapis/java-spanner/compare/v3.2.0...v3.2.1) (2021-01-06)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Bug Fixes
@@ -63,6 +90,15 @@
## [3.2.0](https://www.github.com/googleapis/java-spanner/compare/v3.1.3...v3.2.0) (2020-12-17)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Features
@@ -87,6 +123,15 @@
### [3.1.3](https://www.github.com/googleapis/java-spanner/compare/v3.1.2...v3.1.3) (2020-12-14)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Dependencies
@@ -94,6 +139,15 @@
### [3.1.2](https://www.github.com/googleapis/java-spanner/compare/v3.1.1...v3.1.2) (2020-12-14)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Dependencies
@@ -101,6 +155,15 @@
### [3.1.1](https://www.github.com/googleapis/java-spanner/compare/v3.1.0...v3.1.1) (2020-12-10)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Dependencies
@@ -108,6 +171,15 @@
## [3.1.0](https://www.github.com/googleapis/java-spanner/compare/v3.0.5...v3.1.0) (2020-12-10)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Features
@@ -130,6 +202,15 @@
### [3.0.5](https://www.github.com/googleapis/java-spanner/compare/v3.0.4...v3.0.5) (2020-11-19)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Bug Fixes
@@ -144,6 +225,15 @@
### [3.0.4](https://www.github.com/googleapis/java-spanner/compare/v3.0.3...v3.0.4) (2020-11-17)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Reverts
@@ -151,6 +241,15 @@
### [3.0.3](https://www.github.com/googleapis/java-spanner/compare/v3.0.2...v3.0.3) (2020-11-16)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Dependencies
@@ -158,6 +257,15 @@
### [3.0.2](https://www.github.com/googleapis/java-spanner/compare/v3.0.1...v3.0.2) (2020-11-13)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Bug Fixes
@@ -181,6 +289,15 @@
### [3.0.1](https://www.github.com/googleapis/java-spanner/compare/v3.0.0...v3.0.1) (2020-10-28)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### Bug Fixes
@@ -196,6 +313,15 @@
## [3.0.0](https://www.github.com/googleapis/java-spanner/compare/v2.0.2...v3.0.0) (2020-10-23)
+### ⚠ IMPORTANT: Known issue with this version of the client
+
+Since [v3.0.0](https://github.com/googleapis/java-spanner/releases/tag/v3.0.0), transactions can get stuck if the Spanner backend returns a retryable error when consuming the first record of a read / query in a transaction.
+
+A [fix](https://github.com/googleapis/java-spanner/pull/807) is submitted and available in version [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2)
+
+**Please use [v3.3.2](https://github.com/googleapis/java-spanner/releases/tag/v3.3.2) instead of this version.**
+
+Apologies for the inconvenience.
### ⚠ BREAKING CHANGES
From f4a30d8add0964fe087f1b23037be53c4df2ba62 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Tue, 26 Jan 2021 19:30:22 +0100
Subject: [PATCH 07/42] build(deps): update dependency
com.google.cloud:google-cloud-shared-config to v0.10.0 (#819)
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.9.4` -> `0.10.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
googleapis/java-shared-config
### [`v0.10.0`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#0100-httpswwwgithubcomgoogleapisjava-shared-configcomparev094v0100-2021-01-21)
[Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v0.9.4...v0.10.0)
##### Features
- adding pom profile to generate docfx yml from javadoc ([#213](https://www.github.com/googleapis/java-shared-config/issues/213)) ([3527c47](https://www.github.com/googleapis/java-shared-config/commit/3527c47ff413d415f87fccca84358da2c837841d))
##### Dependencies
- update dependency com.puppycrawl.tools:checkstyle to v8.39 ([#209](https://www.github.com/googleapis/java-shared-config/issues/209)) ([fb53922](https://www.github.com/googleapis/java-shared-config/commit/fb539226d407001822a56c7fff792922cd85d1fe))
##### [0.9.4](https://www.github.com/googleapis/java-shared-config/compare/v0.9.3...v0.9.4) (2020-10-21)
##### Documentation
- Latest for Cloud-RAD ([#199](https://www.github.com/googleapis/java-shared-config/issues/199)) ([34712af](https://www.github.com/googleapis/java-shared-config/commit/34712afac58aa0d148f0843026b3ff770ee030c2))
##### [0.9.3](https://www.github.com/googleapis/java-shared-config/compare/v0.9.2...v0.9.3) (2020-10-15)
##### Dependencies
- update auto-value-annotation.version to v1.7.4 ([#157](https://www.github.com/googleapis/java-shared-config/issues/157)) ([5d7e394](https://www.github.com/googleapis/java-shared-config/commit/5d7e394d964010a3e32af492cec4be85aabc3ebf))
##### [0.9.2](https://www.github.com/googleapis/java-shared-config/compare/v0.9.1...v0.9.2) (2020-07-02)
##### Dependencies
- update dependency org.apache.maven.surefire:surefire-junit47 to v3.0.0-M5 ([#180](https://www.github.com/googleapis/java-shared-config/issues/180)) ([802d9c5](https://www.github.com/googleapis/java-shared-config/commit/802d9c528d34b386face69ca75a014ce57fc3ac1))
##### [0.9.1](https://www.github.com/googleapis/java-shared-config/compare/v0.9.0...v0.9.1) (2020-07-01)
##### Bug Fixes
- maven-dependency-plugin configuration breaking downstream config ([#174](https://www.github.com/googleapis/java-shared-config/issues/174)) ([507217f](https://www.github.com/googleapis/java-shared-config/commit/507217fe509cd4f16eb50c8075ab43229238e08d))
##### Documentation
- change Devsite output path to /java/docs/reference ([#176](https://www.github.com/googleapis/java-shared-config/issues/176)) ([8b98af5](https://www.github.com/googleapis/java-shared-config/commit/8b98af54bf503d97bb86b6d02a5c4301b39384e1))
---
### Renovate configuration
:date: **Schedule**: At any time (no schedule defined).
:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, check this box
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner).
---
google-cloud-spanner-bom/pom.xml | 2 +-
pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml
index 41e4a0c513c..8abee2e6d37 100644
--- a/google-cloud-spanner-bom/pom.xml
+++ b/google-cloud-spanner-bom/pom.xml
@@ -8,7 +8,7 @@
com.google.cloudgoogle-cloud-shared-config
- 0.9.4
+ 0.10.0Google Cloud Spanner BOM
diff --git a/pom.xml b/pom.xml
index 11254547acb..48a162429e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
com.google.cloudgoogle-cloud-shared-config
- 0.9.4
+ 0.10.0
From 8024980326e465a8b4143a6251dc0d3f3a524f57 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Tue, 26 Jan 2021 11:16:39 -0800
Subject: [PATCH 08/42] chore: adding docfx doclet resource (#820)
This PR was generated using Autosynth. :rainbow:
Synth log will be available here:
https://source.cloud.google.com/results/invocations/1376fa4d-7801-4cd6-9cc9-093147d097de/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: https://github.com/googleapis/synthtool/commit/3816b080296d4d52975079fd26c110dd26ba25af
---
.kokoro/release/publish_javadoc.cfg | 3 +++
synth.metadata | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg
index 2a5ec04f9b9..e41d593e948 100644
--- a/.kokoro/release/publish_javadoc.cfg
+++ b/.kokoro/release/publish_javadoc.cfg
@@ -27,3 +27,6 @@ before_action {
}
}
}
+
+# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"
\ No newline at end of file
diff --git a/synth.metadata b/synth.metadata
index 554bb0a42ca..0767da9c0e4 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "4aa770ce669404ad0eca542ae5bd32a421748c18"
+ "sha": "2f1450cb4780590d6660ebae56f96331b78dd973"
}
},
{
@@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
- "sha": "6133907dbb3ddab204a17a15d5c53ec0aae9b033"
+ "sha": "3816b080296d4d52975079fd26c110dd26ba25af"
}
}
],
From a9aa69a27575d00733d0d806b5acf23be32c59cd Mon Sep 17 00:00:00 2001
From: Jeff Ching
Date: Thu, 28 Jan 2021 15:59:53 -0800
Subject: [PATCH 09/42] build: add 3.1.x branch as protected and releasable
(#823)
---
.github/release-please.yml | 6 +++++-
.github/sync-repo-settings.yaml | 27 +++++++++++++++++++++++++++
synth.py | 2 ++
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/.github/release-please.yml b/.github/release-please.yml
index dce2c845092..cfb9fd5c507 100644
--- a/.github/release-please.yml
+++ b/.github/release-please.yml
@@ -1,2 +1,6 @@
releaseType: java-yoshi
-bumpMinorPreMajor: true
\ No newline at end of file
+bumpMinorPreMajor: true
+branches:
+- branch: 3.1.x
+ releaseType: java-yoshi
+ bumpMinorPreMajor: true
diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml
index 6bddd18eac9..9eee4819794 100644
--- a/.github/sync-repo-settings.yaml
+++ b/.github/sync-repo-settings.yaml
@@ -39,6 +39,33 @@ branchProtectionRules:
- "units (11)"
- "Kokoro - Test: Integration"
- "cla/google"
+
+# Identifies the protection rule pattern. Name of the branch to be protected.
+# Defaults to `master`
+- pattern: 3.1.x
+ # Can admins overwrite branch protection.
+ # Defaults to `true`
+ isAdminEnforced: true
+ # Number of approving reviews required to update matching branches.
+ # Defaults to `1`
+ requiredApprovingReviewCount: 1
+ # Are reviews from code owners required to update matching branches.
+ # Defaults to `false`
+ requiresCodeOwnerReviews: true
+ # Require up to date branches
+ requiresStrictStatusChecks: false
+ # List of required status check contexts that must pass for commits to be accepted to matching branches.
+ requiredStatusCheckContexts:
+ - "dependencies (8)"
+ - "dependencies (11)"
+ - "linkage-monitor"
+ - "lint"
+ - "clirr"
+ - "units (7)"
+ - "units (8)"
+ - "units (11)"
+ - "Kokoro - Test: Integration"
+ - "cla/google"
# List of explicit permissions to add (additive only)
permissionRules:
- team: yoshi-admins
diff --git a/synth.py b/synth.py
index 24d6b3074f4..a855da29c03 100644
--- a/synth.py
+++ b/synth.py
@@ -89,4 +89,6 @@
'samples/snapshot/pom.xml',
'samples/snippets/pom.xml',
'.github/CODEOWNERS',
+ '.github/sync-repo-settings.yaml',
+ '.github/release-please.yml',
])
From facda8a7d07a9cf08b1847678b24b270f1abdb38 Mon Sep 17 00:00:00 2001
From: Justin Beckwith
Date: Thu, 28 Jan 2021 22:16:30 -0800
Subject: [PATCH 10/42] build: migrate to flakybot (#826)
---
.kokoro/build.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 8280d10ad67..4572da72d57 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -110,8 +110,8 @@ bash .kokoro/coerce_logs.sh
if [[ "${ENABLE_BUILD_COP}" == "true" ]]
then
- chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop
- ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-spanner
+ chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot
+ ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-spanner
fi
echo "exiting with ${RETURN_CODE}"
From e1e915289755e5f46ba07569d85afda5df5e3f0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Sun, 31 Jan 2021 23:53:01 +0100
Subject: [PATCH 11/42] feat: allow session pool settings in connection url
(#821)
* feat: allow session pool settings in connection url
* fix: use NoCredentials in test
---
.../cloud/spanner/SessionPoolOptions.java | 61 ++++
.../spanner/connection/ConnectionOptions.java | 97 +++++-
.../cloud/spanner/connection/SpannerPool.java | 8 +-
.../connection/ConnectionOptionsTest.java | 24 ++
.../spanner/connection/ConnectionTest.java | 309 +++++++++++-------
.../spanner/connection/SpannerPoolTest.java | 93 ++++--
6 files changed, 432 insertions(+), 160 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java
index 2c68fd317e8..c7432ea40db 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java
@@ -18,6 +18,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
+import java.util.Objects;
import org.threeten.bp.Duration;
/** Options for the session pool used by {@code DatabaseClient}. */
@@ -63,6 +64,48 @@ private SessionPoolOptions(Builder builder) {
this.removeInactiveSessionAfter = builder.removeInactiveSessionAfter;
}
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof SessionPoolOptions)) {
+ return false;
+ }
+ SessionPoolOptions other = (SessionPoolOptions) o;
+ return Objects.equals(this.minSessions, other.minSessions)
+ && Objects.equals(this.maxSessions, other.maxSessions)
+ && Objects.equals(this.incStep, other.incStep)
+ && Objects.equals(this.maxIdleSessions, other.maxIdleSessions)
+ && Objects.equals(this.writeSessionsFraction, other.writeSessionsFraction)
+ && Objects.equals(this.actionOnExhaustion, other.actionOnExhaustion)
+ && Objects.equals(this.actionOnSessionNotFound, other.actionOnSessionNotFound)
+ && Objects.equals(this.actionOnSessionLeak, other.actionOnSessionLeak)
+ && Objects.equals(
+ this.initialWaitForSessionTimeoutMillis, other.initialWaitForSessionTimeoutMillis)
+ && Objects.equals(this.loopFrequency, other.loopFrequency)
+ && Objects.equals(this.keepAliveIntervalMinutes, other.keepAliveIntervalMinutes)
+ && Objects.equals(this.removeInactiveSessionAfter, other.removeInactiveSessionAfter);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ this.minSessions,
+ this.maxSessions,
+ this.incStep,
+ this.maxIdleSessions,
+ this.writeSessionsFraction,
+ this.actionOnExhaustion,
+ this.actionOnSessionNotFound,
+ this.actionOnSessionLeak,
+ this.initialWaitForSessionTimeoutMillis,
+ this.loopFrequency,
+ this.keepAliveIntervalMinutes,
+ this.removeInactiveSessionAfter);
+ }
+
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
public int getMinSessions() {
return minSessions;
}
@@ -165,6 +208,24 @@ public static class Builder {
private int keepAliveIntervalMinutes = 30;
private Duration removeInactiveSessionAfter = Duration.ofMinutes(55L);
+ public Builder() {}
+
+ private Builder(SessionPoolOptions options) {
+ this.minSessionsSet = true;
+ this.minSessions = options.minSessions;
+ this.maxSessions = options.maxSessions;
+ this.incStep = options.incStep;
+ this.maxIdleSessions = options.maxIdleSessions;
+ this.writeSessionsFraction = options.writeSessionsFraction;
+ this.actionOnExhaustion = options.actionOnExhaustion;
+ this.initialWaitForSessionTimeoutMillis = options.initialWaitForSessionTimeoutMillis;
+ this.actionOnSessionNotFound = options.actionOnSessionNotFound;
+ this.actionOnSessionLeak = options.actionOnSessionLeak;
+ this.loopFrequency = options.loopFrequency;
+ this.keepAliveIntervalMinutes = options.keepAliveIntervalMinutes;
+ this.removeInactiveSessionAfter = options.removeInactiveSessionAfter;
+ }
+
/**
* Minimum number of sessions that this pool will always maintain. These will be created eagerly
* in parallel. Defaults to 100.
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java
index a668342f1bf..a688454f303 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java
@@ -150,6 +150,8 @@ public String[] getValidValues() {
static final boolean DEFAULT_RETRY_ABORTS_INTERNALLY = true;
private static final String DEFAULT_CREDENTIALS = null;
private static final String DEFAULT_OAUTH_TOKEN = null;
+ private static final String DEFAULT_MIN_SESSIONS = null;
+ private static final String DEFAULT_MAX_SESSIONS = null;
private static final String DEFAULT_NUM_CHANNELS = null;
private static final String DEFAULT_USER_AGENT = null;
private static final String DEFAULT_OPTIMIZER_VERSION = "";
@@ -172,6 +174,10 @@ public String[] getValidValues() {
* OAuth token to use for authentication. Cannot be used in combination with a credentials file.
*/
public static final String OAUTH_TOKEN_PROPERTY_NAME = "oauthToken";
+ /** Name of the 'minSessions' connection property. */
+ public static final String MIN_SESSIONS_PROPERTY_NAME = "minSessions";
+ /** Name of the 'numChannels' connection property. */
+ public static final String MAX_SESSIONS_PROPERTY_NAME = "maxSessions";
/** Name of the 'numChannels' connection property. */
public static final String NUM_CHANNELS_PROPERTY_NAME = "numChannels";
/** Custom user agent string is only for other Google libraries. */
@@ -204,6 +210,12 @@ public String[] getValidValues() {
ConnectionProperty.createStringProperty(
OAUTH_TOKEN_PROPERTY_NAME,
"A valid pre-existing OAuth token to use for authentication for this connection. Setting this property will take precedence over any value set for a credentials file."),
+ ConnectionProperty.createStringProperty(
+ MIN_SESSIONS_PROPERTY_NAME,
+ "The minimum number of sessions in the backing session pool. The default is 100."),
+ ConnectionProperty.createStringProperty(
+ MAX_SESSIONS_PROPERTY_NAME,
+ "The maximum number of sessions in the backing session pool. The default is 400."),
ConnectionProperty.createStringProperty(
NUM_CHANNELS_PROPERTY_NAME,
"The number of gRPC channels to use to communicate with Cloud Spanner. The default is 4."),
@@ -327,6 +339,9 @@ private boolean isValidUri(String uri) {
* true.
*
readonly (boolean): Sets the initial readonly mode for the connection. Default is
* false.
+ *
minSessions (int): Sets the minimum number of sessions in the backing session pool.
+ *
maxSessions (int): Sets the maximum number of sessions in the backing session pool.
+ *
numChannels (int): Sets the number of gRPC channels to use for the connection.
*
retryAbortsInternally (boolean): Sets the initial retryAbortsInternally mode for the
* connection. Default is true.
*
optimizerVersion (string): Sets the query optimizer version to use for the connection.
@@ -437,6 +452,8 @@ public static Builder newBuilder() {
private final Credentials credentials;
private final SessionPoolOptions sessionPoolOptions;
private final Integer numChannels;
+ private final Integer minSessions;
+ private final Integer maxSessions;
private final String userAgent;
private final QueryOptions queryOptions;
@@ -453,7 +470,6 @@ private ConnectionOptions(Builder builder) {
this.warnings = checkValidProperties(builder.uri);
this.uri = builder.uri;
- this.sessionPoolOptions = builder.sessionPoolOptions;
this.credentialsUrl =
builder.credentialsUrl != null ? builder.credentialsUrl : parseCredentials(builder.uri);
this.oauthToken =
@@ -492,19 +508,12 @@ private ConnectionOptions(Builder builder) {
} else {
this.credentials = getCredentialsService().createCredentials(this.credentialsUrl);
}
- String numChannelsValue = parseNumChannels(builder.uri);
- if (numChannelsValue != null) {
- try {
- this.numChannels = Integer.valueOf(numChannelsValue);
- } catch (NumberFormatException e) {
- throw SpannerExceptionFactory.newSpannerException(
- ErrorCode.INVALID_ARGUMENT,
- "Invalid numChannels value specified: " + numChannelsValue,
- e);
- }
- } else {
- this.numChannels = null;
- }
+ this.minSessions =
+ parseIntegerProperty(MIN_SESSIONS_PROPERTY_NAME, parseMinSessions(builder.uri));
+ this.maxSessions =
+ parseIntegerProperty(MAX_SESSIONS_PROPERTY_NAME, parseMaxSessions(builder.uri));
+ this.numChannels =
+ parseIntegerProperty(NUM_CHANNELS_PROPERTY_NAME, parseNumChannels(builder.uri));
String projectId = matcher.group(Builder.PROJECT_GROUP);
if (Builder.DEFAULT_PROJECT_ID_PLACEHOLDER.equalsIgnoreCase(projectId)) {
@@ -518,6 +527,36 @@ private ConnectionOptions(Builder builder) {
this.statementExecutionInterceptors =
Collections.unmodifiableList(builder.statementExecutionInterceptors);
this.configurator = builder.configurator;
+
+ if (this.minSessions != null || this.maxSessions != null) {
+ SessionPoolOptions.Builder sessionPoolOptionsBuilder =
+ builder.sessionPoolOptions == null
+ ? SessionPoolOptions.newBuilder()
+ : builder.sessionPoolOptions.toBuilder();
+ if (this.minSessions != null) {
+ sessionPoolOptionsBuilder.setMinSessions(this.minSessions);
+ }
+ if (this.maxSessions != null) {
+ sessionPoolOptionsBuilder.setMaxSessions(this.maxSessions);
+ }
+ this.sessionPoolOptions = sessionPoolOptionsBuilder.build();
+ } else {
+ this.sessionPoolOptions = builder.sessionPoolOptions;
+ }
+ }
+
+ private static Integer parseIntegerProperty(String propertyName, String value) {
+ if (value != null) {
+ try {
+ return Integer.valueOf(value);
+ } catch (NumberFormatException e) {
+ throw SpannerExceptionFactory.newSpannerException(
+ ErrorCode.INVALID_ARGUMENT,
+ String.format("Invalid %s value specified: %s", propertyName, value),
+ e);
+ }
+ }
+ return null;
}
SpannerOptionsConfigurator getConfigurator() {
@@ -565,6 +604,18 @@ static String parseOAuthToken(String uri) {
return value != null ? value : DEFAULT_OAUTH_TOKEN;
}
+ @VisibleForTesting
+ static String parseMinSessions(String uri) {
+ String value = parseUriProperty(uri, MIN_SESSIONS_PROPERTY_NAME);
+ return value != null ? value : DEFAULT_MIN_SESSIONS;
+ }
+
+ @VisibleForTesting
+ static String parseMaxSessions(String uri) {
+ String value = parseUriProperty(uri, MAX_SESSIONS_PROPERTY_NAME);
+ return value != null ? value : DEFAULT_MAX_SESSIONS;
+ }
+
@VisibleForTesting
static String parseNumChannels(String uri) {
String value = parseUriProperty(uri, NUM_CHANNELS_PROPERTY_NAME);
@@ -671,6 +722,24 @@ public SessionPoolOptions getSessionPoolOptions() {
return sessionPoolOptions;
}
+ /**
+ * The minimum number of sessions in the backing session pool of this connection. The session pool
+ * is shared between all connections in the same JVM that connect to the same Cloud Spanner
+ * database using the same connection settings.
+ */
+ public Integer getMinSessions() {
+ return minSessions;
+ }
+
+ /**
+ * The maximum number of sessions in the backing session pool of this connection. The session pool
+ * is shared between all connections in the same JVM that connect to the same Cloud Spanner
+ * database using the same connection settings.
+ */
+ public Integer getMaxSessions() {
+ return maxSessions;
+ }
+
/** The number of channels to use for the connection. */
public Integer getNumChannels() {
return numChannels;
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java
index de351c87c93..be5b16e393b 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java
@@ -148,7 +148,8 @@ static class SpannerPoolKey {
private final boolean usePlainText;
private final String userAgent;
- private static SpannerPoolKey of(ConnectionOptions options) {
+ @VisibleForTesting
+ static SpannerPoolKey of(ConnectionOptions options) {
return new SpannerPoolKey(options);
}
@@ -156,7 +157,10 @@ private SpannerPoolKey(ConnectionOptions options) {
this.host = options.getHost();
this.projectId = options.getProjectId();
this.credentialsKey = CredentialsKey.create(options);
- this.sessionPoolOptions = options.getSessionPoolOptions();
+ this.sessionPoolOptions =
+ options.getSessionPoolOptions() == null
+ ? SessionPoolOptions.newBuilder().build()
+ : options.getSessionPoolOptions();
this.numChannels = options.getNumChannels();
this.usePlainText = options.isUsePlainText();
this.userAgent = options.getUserAgent();
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java
index b2f4ea086ca..46452d3fc08 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java
@@ -421,4 +421,28 @@ public void testLenient() {
assertThat(e.getMessage()).contains("bar");
}
}
+
+ @Test
+ public void testMinSessions() {
+ ConnectionOptions options =
+ ConnectionOptions.newBuilder()
+ .setUri(
+ "cloudspanner:/projects/test-project-123/instances/test-instance/databases/test-database?minSessions=400")
+ .setCredentialsUrl(FILE_TEST_PATH)
+ .build();
+ assertThat(options.getMinSessions()).isEqualTo(400);
+ assertThat(options.getSessionPoolOptions().getMinSessions()).isEqualTo(400);
+ }
+
+ @Test
+ public void testMaxSessions() {
+ ConnectionOptions options =
+ ConnectionOptions.newBuilder()
+ .setUri(
+ "cloudspanner:/projects/test-project-123/instances/test-instance/databases/test-database?maxSessions=4000")
+ .setCredentialsUrl(FILE_TEST_PATH)
+ .build();
+ assertThat(options.getMaxSessions()).isEqualTo(4000);
+ assertThat(options.getSessionPoolOptions().getMaxSessions()).isEqualTo(4000);
+ }
}
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java
index de820ccbcc5..4a26721fe8f 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java
@@ -19,156 +19,241 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
import com.google.cloud.spanner.AbortedException;
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.SpannerOptions;
import com.google.cloud.spanner.Statement;
+import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
+import com.google.protobuf.AbstractMessage;
+import com.google.spanner.v1.BatchCreateSessionsRequest;
import com.google.spanner.v1.ExecuteSqlRequest;
import com.google.spanner.v1.ExecuteSqlRequest.QueryOptions;
+import java.util.Arrays;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import org.junit.AfterClass;
import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
-public class ConnectionTest extends AbstractMockServerTest {
- @Test
- public void testDefaultOptimizerVersion() {
- try (Connection connection = createConnection()) {
- try (ResultSet rs =
- connection.executeQuery(Statement.of("SHOW VARIABLE OPTIMIZER_VERSION"))) {
- assertThat(rs.next()).isTrue();
- assertThat(rs.getString("OPTIMIZER_VERSION")).isEqualTo("");
- assertThat(rs.next()).isFalse();
- }
- }
- }
+@RunWith(Enclosed.class)
+public class ConnectionTest {
- @Test
- public void testUseOptimizerVersionFromEnvironment() {
- try {
- SpannerOptions.useEnvironment(
- new SpannerOptions.SpannerEnvironment() {
- @Override
- public String getOptimizerVersion() {
- return "20";
- }
- });
+ public static class DefaultConnectionOptionsTest extends AbstractMockServerTest {
+ @Test
+ public void testDefaultOptimizerVersion() {
try (Connection connection = createConnection()) {
- // Do a query and verify that the version from the environment is used.
- try (ResultSet rs = connection.executeQuery(SELECT_COUNT_STATEMENT)) {
- assertThat(rs.next()).isTrue();
- assertThat(rs.getLong(0)).isEqualTo(COUNT_BEFORE_INSERT);
- assertThat(rs.next()).isFalse();
- // Verify query options from the environment.
- ExecuteSqlRequest request = getLastExecuteSqlRequest();
- assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("20");
- }
- // Now set one of the query options on the connection. That option should be used in
- // combination with the other option from the environment.
- connection.execute(Statement.of("SET OPTIMIZER_VERSION='30'"));
- try (ResultSet rs = connection.executeQuery(SELECT_COUNT_STATEMENT)) {
- assertThat(rs.next()).isTrue();
- assertThat(rs.getLong(0)).isEqualTo(COUNT_BEFORE_INSERT);
- assertThat(rs.next()).isFalse();
-
- ExecuteSqlRequest request = getLastExecuteSqlRequest();
- // Optimizer version should come from the connection.
- assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("30");
- }
- // Now specify options directly for the query. These should override both the environment
- // and what is set on the connection.
try (ResultSet rs =
- connection.executeQuery(
- Statement.newBuilder(SELECT_COUNT_STATEMENT.getSql())
- .withQueryOptions(
- QueryOptions.newBuilder()
- .setOptimizerVersion("user-defined-version")
- .build())
- .build())) {
+ connection.executeQuery(Statement.of("SHOW VARIABLE OPTIMIZER_VERSION"))) {
assertThat(rs.next()).isTrue();
- assertThat(rs.getLong(0)).isEqualTo(COUNT_BEFORE_INSERT);
+ assertThat(rs.getString("OPTIMIZER_VERSION")).isEqualTo("");
assertThat(rs.next()).isFalse();
-
- ExecuteSqlRequest request = getLastExecuteSqlRequest();
- // Optimizer version should come from the query.
- assertThat(request.getQueryOptions().getOptimizerVersion())
- .isEqualTo("user-defined-version");
}
}
- } finally {
- SpannerOptions.useDefaultEnvironment();
}
- }
- @Test
- public void testExecuteInvalidBatchUpdate() {
- try (Connection connection = createConnection()) {
+ @Test
+ public void testUseOptimizerVersionFromEnvironment() {
try {
- connection.executeBatchUpdate(ImmutableList.of(INSERT_STATEMENT, SELECT_RANDOM_STATEMENT));
- fail("Missing expected exception");
- } catch (SpannerException e) {
- assertThat(e.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
+ SpannerOptions.useEnvironment(
+ new SpannerOptions.SpannerEnvironment() {
+ @Override
+ public String getOptimizerVersion() {
+ return "20";
+ }
+ });
+ try (Connection connection = createConnection()) {
+ // Do a query and verify that the version from the environment is used.
+ try (ResultSet rs = connection.executeQuery(SELECT_COUNT_STATEMENT)) {
+ assertThat(rs.next()).isTrue();
+ assertThat(rs.getLong(0)).isEqualTo(COUNT_BEFORE_INSERT);
+ assertThat(rs.next()).isFalse();
+ // Verify query options from the environment.
+ ExecuteSqlRequest request = getLastExecuteSqlRequest();
+ assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("20");
+ }
+ // Now set one of the query options on the connection. That option should be used in
+ // combination with the other option from the environment.
+ connection.execute(Statement.of("SET OPTIMIZER_VERSION='30'"));
+ try (ResultSet rs = connection.executeQuery(SELECT_COUNT_STATEMENT)) {
+ assertThat(rs.next()).isTrue();
+ assertThat(rs.getLong(0)).isEqualTo(COUNT_BEFORE_INSERT);
+ assertThat(rs.next()).isFalse();
+
+ ExecuteSqlRequest request = getLastExecuteSqlRequest();
+ // Optimizer version should come from the connection.
+ assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("30");
+ }
+ // Now specify options directly for the query. These should override both the environment
+ // and what is set on the connection.
+ try (ResultSet rs =
+ connection.executeQuery(
+ Statement.newBuilder(SELECT_COUNT_STATEMENT.getSql())
+ .withQueryOptions(
+ QueryOptions.newBuilder()
+ .setOptimizerVersion("user-defined-version")
+ .build())
+ .build())) {
+ assertThat(rs.next()).isTrue();
+ assertThat(rs.getLong(0)).isEqualTo(COUNT_BEFORE_INSERT);
+ assertThat(rs.next()).isFalse();
+
+ ExecuteSqlRequest request = getLastExecuteSqlRequest();
+ // Optimizer version should come from the query.
+ assertThat(request.getQueryOptions().getOptimizerVersion())
+ .isEqualTo("user-defined-version");
+ }
+ }
+ } finally {
+ SpannerOptions.useDefaultEnvironment();
}
}
- }
- @Test
- public void testQueryAborted() {
- try (Connection connection = createConnection()) {
- connection.setRetryAbortsInternally(false);
- for (boolean abort : new Boolean[] {true, false}) {
+ @Test
+ public void testExecuteInvalidBatchUpdate() {
+ try (Connection connection = createConnection()) {
try {
- if (abort) {
- mockSpanner.abortNextStatement();
+ connection.executeBatchUpdate(
+ ImmutableList.of(INSERT_STATEMENT, SELECT_RANDOM_STATEMENT));
+ fail("Missing expected exception");
+ } catch (SpannerException e) {
+ assertThat(e.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
+ }
+ }
+ }
+
+ @Test
+ public void testQueryAborted() {
+ try (Connection connection = createConnection()) {
+ connection.setRetryAbortsInternally(false);
+ for (boolean abort : new Boolean[] {true, false}) {
+ try {
+ if (abort) {
+ mockSpanner.abortNextStatement();
+ }
+ connection.executeQuery(SELECT_RANDOM_STATEMENT);
+ assertThat(abort).isFalse();
+ connection.commit();
+ } catch (AbortedException e) {
+ assertThat(abort).isTrue();
+ connection.rollback();
}
- connection.executeQuery(SELECT_RANDOM_STATEMENT);
- assertThat(abort).isFalse();
- connection.commit();
- } catch (AbortedException e) {
- assertThat(abort).isTrue();
- connection.rollback();
}
}
}
- }
- @Test
- public void testUpdateAborted() {
- try (Connection connection = createConnection()) {
- connection.setRetryAbortsInternally(false);
- for (boolean abort : new Boolean[] {true, false}) {
- try {
- if (abort) {
- mockSpanner.abortNextStatement();
+ @Test
+ public void testUpdateAborted() {
+ try (Connection connection = createConnection()) {
+ connection.setRetryAbortsInternally(false);
+ for (boolean abort : new Boolean[] {true, false}) {
+ try {
+ if (abort) {
+ mockSpanner.abortNextStatement();
+ }
+ connection.executeUpdate(INSERT_STATEMENT);
+ assertThat(abort).isFalse();
+ connection.commit();
+ } catch (AbortedException e) {
+ assertThat(abort).isTrue();
+ connection.rollback();
}
- connection.executeUpdate(INSERT_STATEMENT);
- assertThat(abort).isFalse();
- connection.commit();
- } catch (AbortedException e) {
- assertThat(abort).isTrue();
- connection.rollback();
}
}
}
- }
- @Test
- public void testBatchUpdateAborted() {
- try (Connection connection = createConnection()) {
- connection.setRetryAbortsInternally(false);
- for (boolean abort : new Boolean[] {true, false}) {
- try {
- if (abort) {
- mockSpanner.abortNextStatement();
+ @Test
+ public void testBatchUpdateAborted() {
+ try (Connection connection = createConnection()) {
+ connection.setRetryAbortsInternally(false);
+ for (boolean abort : new Boolean[] {true, false}) {
+ try {
+ if (abort) {
+ mockSpanner.abortNextStatement();
+ }
+ connection.executeBatchUpdate(ImmutableList.of(INSERT_STATEMENT, INSERT_STATEMENT));
+ assertThat(abort).isFalse();
+ connection.commit();
+ } catch (AbortedException e) {
+ assertThat(abort).isTrue();
+ connection.rollback();
}
- connection.executeBatchUpdate(ImmutableList.of(INSERT_STATEMENT, INSERT_STATEMENT));
- assertThat(abort).isFalse();
- connection.commit();
- } catch (AbortedException e) {
- assertThat(abort).isTrue();
- connection.rollback();
}
}
}
}
+
+ public static class ConnectionMinSessionsTest extends AbstractMockServerTest {
+
+ @AfterClass
+ public static void reset() {
+ mockSpanner.reset();
+ }
+
+ protected String getBaseUrl() {
+ return super.getBaseUrl() + ";minSessions=1";
+ }
+
+ @Test
+ public void testMinSessions() throws InterruptedException, TimeoutException {
+ try (Connection connection = createConnection()) {
+ mockSpanner.waitForRequestsToContain(
+ new Predicate() {
+ @Override
+ public boolean apply(AbstractMessage input) {
+ return input instanceof BatchCreateSessionsRequest
+ && ((BatchCreateSessionsRequest) input).getSessionCount() == 1;
+ }
+ },
+ 5000L);
+ }
+ }
+ }
+
+ public static class ConnectionMaxSessionsTest extends AbstractMockServerTest {
+
+ @AfterClass
+ public static void reset() {
+ mockSpanner.reset();
+ }
+
+ protected String getBaseUrl() {
+ return super.getBaseUrl() + ";maxSessions=1";
+ }
+
+ @Test
+ public void testMaxSessions()
+ throws InterruptedException, TimeoutException, ExecutionException {
+ try (Connection connection1 = createConnection();
+ Connection connection2 = createConnection()) {
+ connection1.beginTransactionAsync();
+ connection2.beginTransactionAsync();
+
+ ApiFuture count1 = connection1.executeUpdateAsync(INSERT_STATEMENT);
+ ApiFuture count2 = connection2.executeUpdateAsync(INSERT_STATEMENT);
+
+ // Commit the transactions. Both should be able to finish, but both used the same session.
+ ApiFuture commit1 = connection1.commitAsync();
+ ApiFuture commit2 = connection2.commitAsync();
+
+ // At least one transaction must wait until the other has finished before it can get a
+ // session.
+ assertThat(count1.isDone() && count2.isDone()).isFalse();
+ assertThat(commit1.isDone() && commit2.isDone()).isFalse();
+
+ // Wait until both finishes.
+ ApiFutures.allAsList(Arrays.asList(commit1, commit2)).get(5L, TimeUnit.SECONDS);
+
+ assertThat(count1.isDone()).isTrue();
+ assertThat(count2.isDone()).isTrue();
+ }
+ assertThat(mockSpanner.numSessionsCreated()).isEqualTo(1);
+ }
+ }
}
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
index afc0512b4ec..19d6dfddcde 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
@@ -16,10 +16,7 @@
package com.google.cloud.spanner.connection;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
@@ -33,6 +30,7 @@
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.connection.ConnectionImpl.LeakedConnectionException;
import com.google.cloud.spanner.connection.SpannerPool.CheckAndCloseSpannersMode;
+import com.google.cloud.spanner.connection.SpannerPool.SpannerPoolKey;
import com.google.common.base.Ticker;
import com.google.common.testing.FakeTicker;
import java.io.ByteArrayOutputStream;
@@ -108,40 +106,40 @@ public void testGetSpanner() {
// assert equal
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options1, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
spanner1 = pool.getSpanner(options2, connection1);
spanner2 = pool.getSpanner(options2, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
spanner1 = pool.getSpanner(options3, connection1);
spanner2 = pool.getSpanner(options3, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
spanner1 = pool.getSpanner(options4, connection1);
spanner2 = pool.getSpanner(options4, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// Options 5 and 6 both use default credentials.
spanner1 = pool.getSpanner(options5, connection1);
spanner2 = pool.getSpanner(options6, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// assert not equal
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options2, connection2);
- assertThat(spanner1, not(equalTo(spanner2)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options3, connection2);
- assertThat(spanner1, not(equalTo(spanner2)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options4, connection2);
- assertThat(spanner1, not(equalTo(spanner2)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
spanner1 = pool.getSpanner(options2, connection1);
spanner2 = pool.getSpanner(options3, connection2);
- assertThat(spanner1, not(equalTo(spanner2)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
spanner1 = pool.getSpanner(options2, connection1);
spanner2 = pool.getSpanner(options4, connection2);
- assertThat(spanner1, not(equalTo(spanner2)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
spanner1 = pool.getSpanner(options3, connection1);
spanner2 = pool.getSpanner(options4, connection2);
- assertThat(spanner1, not(equalTo(spanner2)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
}
@Test
@@ -153,17 +151,17 @@ public void testRemoveConnection() {
// assert equal
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options1, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// one connection removed, assert that we would still get the same Spanner
pool.removeConnection(options1, connection1);
spanner1 = pool.getSpanner(options1, connection1);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// remove two connections, assert that we would still get the same Spanner, as Spanners are not
// directly closed and removed.
pool.removeConnection(options1, connection1);
pool.removeConnection(options1, connection2);
spanner1 = pool.getSpanner(options1, connection1);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// remove the last connection again
pool.removeConnection(options1, connection1);
}
@@ -200,7 +198,7 @@ public void testRemoveConnectionOptionsNotRegistered() {
pool.getSpanner(options1, connection1);
pool.removeConnection(options2, connection1);
String capturedLog = getTestCapturedLog();
- assertThat(capturedLog.contains(expectedLogPart), is(true));
+ assertThat(capturedLog.contains(expectedLogPart)).isTrue();
}
@Test
@@ -211,7 +209,7 @@ public void testRemoveConnectionConnectionNotRegistered() {
pool.getSpanner(options1, connection1);
pool.removeConnection(options1, connection2);
String capturedLog = getTestCapturedLog();
- assertThat(capturedLog.contains(expectedLogPart), is(true));
+ assertThat(capturedLog.contains(expectedLogPart)).isTrue();
}
@Test
@@ -223,7 +221,7 @@ public void testRemoveConnectionConnectionAlreadyRemoved() {
pool.removeConnection(options1, connection1);
pool.removeConnection(options1, connection1);
String capturedLog = getTestCapturedLog();
- assertThat(capturedLog.contains(expectedLogPart), is(true));
+ assertThat(capturedLog.contains(expectedLogPart)).isTrue();
}
@Test
@@ -237,7 +235,7 @@ public void testCloseSpanner() {
} catch (SpannerException e) {
exception = e.getErrorCode() == ErrorCode.FAILED_PRECONDITION;
}
- assertThat(exception, is(true));
+ assertThat(exception).isTrue();
// remove the connection and verify that it is possible to close
pool.removeConnection(options1, connection1);
@@ -249,7 +247,7 @@ public void testCloseSpanner() {
Spanner spanner2 = pool.getSpanner(options1, connection1);
pool.checkAndCloseSpanners(CheckAndCloseSpannersMode.WARN);
String capturedLog = getTestCapturedLog();
- assertThat(capturedLog.contains(expectedLogPart), is(true));
+ assertThat(capturedLog.contains(expectedLogPart)).isTrue();
verify(spanner2, never()).close();
// remove the connection and verify that it is possible to close
@@ -273,11 +271,11 @@ public void testLeakedConnection() {
ConnectionOptions.closeSpanner();
fail("missing expected exception");
} catch (SpannerException e) {
- assertThat(e.getErrorCode(), is(equalTo(ErrorCode.FAILED_PRECONDITION)));
+ assertThat(e.getErrorCode()).isEqualTo(ErrorCode.FAILED_PRECONDITION);
}
String capturedLog = getTestCapturedLog();
- assertThat(capturedLog.contains(LeakedConnectionException.class.getName()), is(true));
- assertThat(capturedLog.contains("testLeakedConnection"), is(true));
+ assertThat(capturedLog.contains(LeakedConnectionException.class.getName())).isTrue();
+ assertThat(capturedLog.contains("testLeakedConnection")).isTrue();
// Now close the connection to avoid trouble with other test cases.
connection.close();
}
@@ -292,7 +290,7 @@ public void testCloseUnusedSpanners() {
// create two connections that use the same Spanner
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options1, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// all spanners are in use, this should have no effect
pool.closeUnusedSpanners(-1L);
@@ -312,8 +310,8 @@ public void testCloseUnusedSpanners() {
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options2, connection2);
spanner3 = pool.getSpanner(options2, connection3);
- assertThat(spanner1, not(equalTo(spanner2)));
- assertThat(spanner2, is(equalTo(spanner3)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
+ assertThat(spanner2).isEqualTo(spanner3);
// all spanners are in use, this should have no effect
pool.closeUnusedSpanners(-1L);
@@ -359,7 +357,7 @@ public void testAutomaticCloser() throws InterruptedException {
// create two connections that use the same Spanner
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options1, connection2);
- assertThat(spanner1, is(equalTo(spanner2)));
+ assertThat(spanner1).isEqualTo(spanner2);
// all spanners are in use, this should have no effect
ticker.advance(TEST_AUTOMATIC_CLOSE_TIMEOUT_NANOS + MILLISECOND);
@@ -382,8 +380,8 @@ public void testAutomaticCloser() throws InterruptedException {
spanner1 = pool.getSpanner(options1, connection1);
spanner2 = pool.getSpanner(options2, connection2);
spanner3 = pool.getSpanner(options2, connection3);
- assertThat(spanner1, not(equalTo(spanner2)));
- assertThat(spanner2, is(equalTo(spanner3)));
+ assertThat(spanner1).isNotEqualTo(spanner2);
+ assertThat(spanner2).isEqualTo(spanner3);
// all spanners are in use, this should have no effect
ticker.advance(TEST_AUTOMATIC_CLOSE_TIMEOUT_NANOS + MILLISECOND);
@@ -416,4 +414,35 @@ public void testAutomaticCloser() throws InterruptedException {
verify(spanner2).close();
verify(spanner3).close();
}
+
+ @Test
+ public void testSpannerPoolKeyEquality() {
+ ConnectionOptions options1 =
+ ConnectionOptions.newBuilder()
+ .setUri(
+ "cloudspanner:/projects/p/instances/i/databases/d?minSessions=200;maxSessions=400")
+ .setCredentials(NoCredentials.getInstance())
+ .build();
+ // options2 equals the default session pool options, and is therefore equal to ConnectionOptions
+ // without any session pool configuration.
+ ConnectionOptions options2 =
+ ConnectionOptions.newBuilder()
+ .setUri(
+ "cloudspanner:/projects/p/instances/i/databases/d?minSessions=100;maxSessions=400")
+ .setCredentials(NoCredentials.getInstance())
+ .build();
+ ConnectionOptions options3 =
+ ConnectionOptions.newBuilder()
+ .setUri("cloudspanner:/projects/p/instances/i/databases/d")
+ .setCredentials(NoCredentials.getInstance())
+ .build();
+
+ SpannerPoolKey key1 = SpannerPoolKey.of(options1);
+ SpannerPoolKey key2 = SpannerPoolKey.of(options2);
+ SpannerPoolKey key3 = SpannerPoolKey.of(options3);
+
+ assertThat(key1).isNotEqualTo(key2);
+ assertThat(key2).isEqualTo(key3);
+ assertThat(key1).isNotEqualTo(key3);
+ }
}
From eaf673dd79cbb3fc99807764eb698d6344da3c8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Sun, 31 Jan 2021 23:54:16 +0100
Subject: [PATCH 12/42] test: remove write fraction from test (#832)
---
.../cloud/spanner/SessionPoolStressTest.java | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolStressTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolStressTest.java
index a3b2a3c5425..2f0cd239abd 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolStressTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolStressTest.java
@@ -62,9 +62,6 @@
public class SessionPoolStressTest extends BaseSessionPoolTest {
@Parameter(0)
- public double writeSessionsFraction;
-
- @Parameter(1)
public boolean shouldBlock;
DatabaseId db = DatabaseId.of("projects/p/instances/i/databases/unused");
@@ -85,13 +82,11 @@ public class SessionPoolStressTest extends BaseSessionPoolTest {
int minSessionsWhenSessionClosed = Integer.MAX_VALUE;
Exception e;
- @Parameters(name = "write fraction = {0}, should block = {1}")
+ @Parameters(name = "should block = {0}")
public static Collection
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index bec35d771e8..93f5eff505b 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -22,7 +22,7 @@
1.8UTF-80.28.3
- 1.2.10
+ 1.2.112.0.11
From 717700283e79c640cf1184e256e14d657fb0ffc7 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Sun, 31 Jan 2021 16:38:23 -0800
Subject: [PATCH 17/42] chore: updates flakybot to new name buildcop (#828)
---
.kokoro/build.sh | 4 ++--
synth.metadata | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 4572da72d57..8280d10ad67 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -110,8 +110,8 @@ bash .kokoro/coerce_logs.sh
if [[ "${ENABLE_BUILD_COP}" == "true" ]]
then
- chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot
- ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-spanner
+ chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop
+ ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-spanner
fi
echo "exiting with ${RETURN_CODE}"
diff --git a/synth.metadata b/synth.metadata
index 0767da9c0e4..d9eb2060851 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "2f1450cb4780590d6660ebae56f96331b78dd973"
+ "sha": "facda8a7d07a9cf08b1847678b24b270f1abdb38"
}
},
{
@@ -60,7 +60,6 @@
".github/blunderbuss.yml",
".github/generated-files-bot.yml",
".github/readme/synth.py",
- ".github/release-please.yml",
".github/snippet-bot.yml",
".github/trusted-contribution.yml",
".github/workflows/approve-readme.yaml",
From 004c5d759804a380e65d1023faef0978de5d3ff9 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Sun, 31 Jan 2021 16:42:00 -0800
Subject: [PATCH 18/42] chore: adds PITR fields to backup and database (#829)
* chore: updates flakybot to new name buildcop
* feat: adds PITR fields to backup and database
PiperOrigin-RevId: 354462069
Source-Author: Google APIs
Source-Date: Thu Jan 28 21:22:16 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 30eb779ddcc4f389df34d0802d081ef6c4559d6d
Source-Link: https://github.com/googleapis/googleapis/commit/30eb779ddcc4f389df34d0802d081ef6c4559d6d
---
.../database/v1/DatabaseAdminClient.java | 6 +-
.../database/v1/DatabaseAdminClientTest.java | 21 +
.../spanner/admin/database/v1/Backup.java | 394 +++++++++++--
.../spanner/admin/database/v1/BackupInfo.java | 398 +++++++++++--
.../database/v1/BackupInfoOrBuilder.java | 65 ++-
.../admin/database/v1/BackupOrBuilder.java | 65 ++-
.../admin/database/v1/BackupProto.java | 107 ++--
.../database/v1/CreateBackupMetadata.java | 28 +-
.../v1/CreateBackupMetadataOrBuilder.java | 8 +-
.../spanner/admin/database/v1/Database.java | 524 ++++++++++++++++++
.../admin/database/v1/DatabaseOrBuilder.java | 77 +++
.../database/v1/GetDatabaseDdlRequest.java | 14 +
.../v1/GetDatabaseDdlRequestOrBuilder.java | 4 +
.../v1/ListBackupOperationsRequest.java | 42 +-
.../ListBackupOperationsRequestOrBuilder.java | 12 +-
.../v1/ListDatabaseOperationsRequest.java | 70 +--
...istDatabaseOperationsRequestOrBuilder.java | 20 +-
.../v1/OptimizeRestoredDatabaseMetadata.java | 14 +-
...mizeRestoredDatabaseMetadataOrBuilder.java | 4 +-
.../database/v1/RestoreDatabaseMetadata.java | 14 +-
.../v1/RestoreDatabaseMetadataOrBuilder.java | 4 +-
.../v1/SpannerDatabaseAdminProto.java | 344 ++++++------
.../spanner/admin/database/v1/backup.proto | 44 +-
.../database/v1/spanner_database_admin.proto | 31 +-
synth.metadata | 4 +-
25 files changed, 1859 insertions(+), 455 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
index c30e4ab1269..cab26e07702 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
@@ -570,7 +570,8 @@ public final UnaryCallable dropDatabaseCallable() {
* method does not show pending schema updates, those may be queried using the
* [Operations][google.longrunning.Operations] API.
*
- * @param database Required. The database whose schema we wish to get.
+ * @param database Required. The database whose schema we wish to get. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GetDatabaseDdlResponse getDatabaseDdl(DatabaseName database) {
@@ -587,7 +588,8 @@ public final GetDatabaseDdlResponse getDatabaseDdl(DatabaseName database) {
* method does not show pending schema updates, those may be queried using the
* [Operations][google.longrunning.Operations] API.
*
- * @param database Required. The database whose schema we wish to get.
+ * @param database Required. The database whose schema we wish to get. Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GetDatabaseDdlResponse getDatabaseDdl(String database) {
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
index 956f66ee6cf..20a1869946e 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
@@ -217,6 +217,8 @@ public void createDatabaseTest() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
@@ -268,6 +270,8 @@ public void createDatabaseTest2() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
@@ -319,6 +323,8 @@ public void getDatabaseTest() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
mockDatabaseAdmin.addResponse(expectedResponse);
@@ -359,6 +365,8 @@ public void getDatabaseTest2() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
mockDatabaseAdmin.addResponse(expectedResponse);
@@ -871,6 +879,7 @@ public void createBackupTest() throws Exception {
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ .setVersionTime(Timestamp.newBuilder().build())
.setExpireTime(Timestamp.newBuilder().build())
.setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
.setCreateTime(Timestamp.newBuilder().build())
@@ -928,6 +937,7 @@ public void createBackupTest2() throws Exception {
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ .setVersionTime(Timestamp.newBuilder().build())
.setExpireTime(Timestamp.newBuilder().build())
.setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
.setCreateTime(Timestamp.newBuilder().build())
@@ -985,6 +995,7 @@ public void getBackupTest() throws Exception {
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ .setVersionTime(Timestamp.newBuilder().build())
.setExpireTime(Timestamp.newBuilder().build())
.setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
.setCreateTime(Timestamp.newBuilder().build())
@@ -1028,6 +1039,7 @@ public void getBackupTest2() throws Exception {
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ .setVersionTime(Timestamp.newBuilder().build())
.setExpireTime(Timestamp.newBuilder().build())
.setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
.setCreateTime(Timestamp.newBuilder().build())
@@ -1071,6 +1083,7 @@ public void updateBackupTest() throws Exception {
Backup expectedResponse =
Backup.newBuilder()
.setDatabase(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
+ .setVersionTime(Timestamp.newBuilder().build())
.setExpireTime(Timestamp.newBuilder().build())
.setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString())
.setCreateTime(Timestamp.newBuilder().build())
@@ -1275,6 +1288,8 @@ public void restoreDatabaseTest() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
@@ -1329,6 +1344,8 @@ public void restoreDatabaseTest2() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
@@ -1383,6 +1400,8 @@ public void restoreDatabaseTest3() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
@@ -1437,6 +1456,8 @@ public void restoreDatabaseTest4() throws Exception {
.setName(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
.setCreateTime(Timestamp.newBuilder().build())
.setRestoreInfo(RestoreInfo.newBuilder().build())
+ .setVersionRetentionPeriod("versionRetentionPeriod-629783929")
+ .setEarliestVersionTime(Timestamp.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
index 0d9230003e1..935d46f59df 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
@@ -138,6 +138,21 @@ private Backup(
mutable_bitField0_ |= 0x00000001;
}
referencingDatabases_.add(s);
+ break;
+ }
+ case 74:
+ {
+ com.google.protobuf.Timestamp.Builder subBuilder = null;
+ if (versionTime_ != null) {
+ subBuilder = versionTime_.toBuilder();
+ }
+ versionTime_ =
+ input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(versionTime_);
+ versionTime_ = subBuilder.buildPartial();
+ }
+
break;
}
default:
@@ -393,6 +408,61 @@ public com.google.protobuf.ByteString getDatabaseBytes() {
}
}
+ public static final int VERSION_TIME_FIELD_NUMBER = 9;
+ private com.google.protobuf.Timestamp versionTime_;
+ /**
+ *
+ *
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ *
+ * .google.protobuf.Timestamp version_time = 9;
+ */
+ @java.lang.Override
+ public com.google.protobuf.TimestampOrBuilder getVersionTimeOrBuilder() {
+ return getVersionTime();
+ }
+
public static final int EXPIRE_TIME_FIELD_NUMBER = 3;
private com.google.protobuf.Timestamp expireTime_;
/**
@@ -529,10 +599,9 @@ public com.google.protobuf.ByteString getNameBytes() {
*
*
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
*
*
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java
index 99bc0f10191..56ce510e170 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java
@@ -98,6 +98,21 @@ private BackupInfo(
java.lang.String s = input.readStringRequireUtf8();
sourceDatabase_ = s;
+ break;
+ }
+ case 34:
+ {
+ com.google.protobuf.Timestamp.Builder subBuilder = null;
+ if (versionTime_ != null) {
+ subBuilder = versionTime_.toBuilder();
+ }
+ versionTime_ =
+ input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(versionTime_);
+ versionTime_ = subBuilder.buildPartial();
+ }
+
break;
}
default:
@@ -143,7 +158,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return The backup.
*/
@@ -166,7 +181,7 @@ public java.lang.String getBackup() {
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for backup.
*/
@@ -183,14 +198,72 @@ public com.google.protobuf.ByteString getBackupBytes() {
}
}
+ public static final int VERSION_TIME_FIELD_NUMBER = 4;
+ private com.google.protobuf.Timestamp versionTime_;
+ /**
+ *
+ *
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ *
+ * .google.protobuf.Timestamp version_time = 4;
+ */
+ @java.lang.Override
+ public com.google.protobuf.TimestampOrBuilder getVersionTimeOrBuilder() {
+ return getVersionTime();
+ }
+
public static final int CREATE_TIME_FIELD_NUMBER = 2;
private com.google.protobuf.Timestamp createTime_;
/**
*
*
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
*
* .google.protobuf.Timestamp create_time = 2;
@@ -241,7 +314,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return The sourceDatabase.
*/
@@ -264,7 +337,7 @@ public java.lang.String getSourceDatabase() {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for sourceDatabase.
*/
@@ -304,6 +377,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!getSourceDatabaseBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceDatabase_);
}
+ if (versionTime_ != null) {
+ output.writeMessage(4, getVersionTime());
+ }
unknownFields.writeTo(output);
}
@@ -322,6 +398,9 @@ public int getSerializedSize() {
if (!getSourceDatabaseBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceDatabase_);
}
+ if (versionTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getVersionTime());
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -339,6 +418,10 @@ public boolean equals(final java.lang.Object obj) {
(com.google.spanner.admin.database.v1.BackupInfo) obj;
if (!getBackup().equals(other.getBackup())) return false;
+ if (hasVersionTime() != other.hasVersionTime()) return false;
+ if (hasVersionTime()) {
+ if (!getVersionTime().equals(other.getVersionTime())) return false;
+ }
if (hasCreateTime() != other.hasCreateTime()) return false;
if (hasCreateTime()) {
if (!getCreateTime().equals(other.getCreateTime())) return false;
@@ -357,6 +440,10 @@ public int hashCode() {
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + BACKUP_FIELD_NUMBER;
hash = (53 * hash) + getBackup().hashCode();
+ if (hasVersionTime()) {
+ hash = (37 * hash) + VERSION_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getVersionTime().hashCode();
+ }
if (hasCreateTime()) {
hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
hash = (53 * hash) + getCreateTime().hashCode();
@@ -510,6 +597,12 @@ public Builder clear() {
super.clear();
backup_ = "";
+ if (versionTimeBuilder_ == null) {
+ versionTime_ = null;
+ } else {
+ versionTime_ = null;
+ versionTimeBuilder_ = null;
+ }
if (createTimeBuilder_ == null) {
createTime_ = null;
} else {
@@ -546,6 +639,11 @@ public com.google.spanner.admin.database.v1.BackupInfo buildPartial() {
com.google.spanner.admin.database.v1.BackupInfo result =
new com.google.spanner.admin.database.v1.BackupInfo(this);
result.backup_ = backup_;
+ if (versionTimeBuilder_ == null) {
+ result.versionTime_ = versionTime_;
+ } else {
+ result.versionTime_ = versionTimeBuilder_.build();
+ }
if (createTimeBuilder_ == null) {
result.createTime_ = createTime_;
} else {
@@ -606,6 +704,9 @@ public Builder mergeFrom(com.google.spanner.admin.database.v1.BackupInfo other)
backup_ = other.backup_;
onChanged();
}
+ if (other.hasVersionTime()) {
+ mergeVersionTime(other.getVersionTime());
+ }
if (other.hasCreateTime()) {
mergeCreateTime(other.getCreateTime());
}
@@ -650,7 +751,7 @@ public Builder mergeFrom(
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return The backup.
*/
@@ -672,7 +773,7 @@ public java.lang.String getBackup() {
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for backup.
*/
@@ -694,7 +795,7 @@ public com.google.protobuf.ByteString getBackupBytes() {
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The backup to set.
* @return This builder for chaining.
@@ -715,7 +816,7 @@ public Builder setBackup(java.lang.String value) {
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return This builder for chaining.
*/
@@ -732,7 +833,7 @@ public Builder clearBackup() {
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The bytes for backup to set.
* @return This builder for chaining.
@@ -748,6 +849,227 @@ public Builder setBackupBytes(com.google.protobuf.ByteString value) {
return this;
}
+ private com.google.protobuf.Timestamp versionTime_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ versionTimeBuilder_;
+ /**
+ *
+ *
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
*
* .google.protobuf.Timestamp create_time = 2;
@@ -948,7 +1270,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return The sourceDatabase.
*/
@@ -970,7 +1292,7 @@ public java.lang.String getSourceDatabase() {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for sourceDatabase.
*/
@@ -992,7 +1314,7 @@ public com.google.protobuf.ByteString getSourceDatabaseBytes() {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @param value The sourceDatabase to set.
* @return This builder for chaining.
@@ -1013,7 +1335,7 @@ public Builder setSourceDatabase(java.lang.String value) {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return This builder for chaining.
*/
@@ -1030,7 +1352,7 @@ public Builder clearSourceDatabase() {
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @param value The bytes for sourceDatabase to set.
* @return This builder for chaining.
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java
index 250b63bc124..0d3766f1a33 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java
@@ -30,7 +30,7 @@ public interface BackupInfoOrBuilder
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return The backup.
*/
@@ -42,7 +42,7 @@ public interface BackupInfoOrBuilder
* Name of the backup.
*
*
- * string backup = 1;
+ * string backup = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for backup.
*/
@@ -53,7 +53,54 @@ public interface BackupInfoOrBuilder
*
*
* The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
+ * The backup contains an externally consistent copy of `source_database` at
+ * the timestamp specified by `version_time`. If the
+ * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ * `version_time`, the `version_time` of the backup is equivalent to the
+ * `create_time`.
+ *
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
- * The backup contains an externally consistent copy of `source_database` at
- * the timestamp specified by `create_time`.
+ * The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ * received.
*
*
* .google.protobuf.Timestamp create_time = 2;
@@ -93,7 +140,7 @@ public interface BackupInfoOrBuilder
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return The sourceDatabase.
*/
@@ -105,7 +152,7 @@ public interface BackupInfoOrBuilder
* Name of the database the backup was created from.
*
*
- * string source_database = 3;
+ * string source_database = 3 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for sourceDatabase.
*/
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
index 2b7f566b122..67cfab26fc9 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
@@ -56,6 +56,50 @@ public interface BackupOrBuilder
*/
com.google.protobuf.ByteString getDatabaseBytes();
+ /**
+ *
+ *
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
+ * The backup will contain an externally consistent copy of the database at
+ * the timestamp specified by `version_time`. If `version_time` is not
+ * specified, the system will set `version_time` to the `create_time` of the
+ * backup.
+ *
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
- * Output only. The backup will contain an externally consistent
- * copy of the database at the timestamp specified by
- * `create_time`. `create_time` is approximately the time the
- * [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ * Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ * request is received. If the request does not specify `version_time`, the
+ * `version_time` of the backup will be equivalent to the `create_time`.
*
*
* .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
index 2aaecf7bcd8..dd28586f35e 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
@@ -88,56 +88,62 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "d_mask.proto\032\037google/protobuf/timestamp."
+ "proto\032-google/spanner/admin/database/v1/"
+ "common.proto\032\034google/api/annotations.pro"
- + "to\"\315\003\n\006Backup\0226\n\010database\030\002 \001(\tB$\372A!\n\037sp"
- + "anner.googleapis.com/Database\022/\n\013expire_"
- + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\014"
- + "\n\004name\030\001 \001(\t\0224\n\013create_time\030\004 \001(\0132\032.goog"
- + "le.protobuf.TimestampB\003\340A\003\022\027\n\nsize_bytes"
- + "\030\005 \001(\003B\003\340A\003\022B\n\005state\030\006 \001(\0162..google.span"
- + "ner.admin.database.v1.Backup.StateB\003\340A\003\022"
- + "\"\n\025referencing_databases\030\007 \003(\tB\003\340A\003\"7\n\005S"
- + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020"
- + "\001\022\t\n\005READY\020\002:\\\352AY\n\035spanner.googleapis.co"
- + "m/Backup\0228projects/{project}/instances/{"
- + "instance}/backups/{backup}\"\245\001\n\023CreateBac"
- + "kupRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037span"
- + "ner.googleapis.com/Instance\022\026\n\tbackup_id"
- + "\030\002 \001(\tB\003\340A\002\022=\n\006backup\030\003 \001(\0132(.google.spa"
- + "nner.admin.database.v1.BackupB\003\340A\002\"\256\001\n\024C"
- + "reateBackupMetadata\022\014\n\004name\030\001 \001(\t\022\020\n\010dat"
- + "abase\030\002 \001(\t\022E\n\010progress\030\003 \001(\01323.google.s"
- + "panner.admin.database.v1.OperationProgre"
- + "ss\022/\n\013cancel_time\030\004 \001(\0132\032.google.protobu"
- + "f.Timestamp\"\212\001\n\023UpdateBackupRequest\022=\n\006b"
- + "ackup\030\001 \001(\0132(.google.spanner.admin.datab"
- + "ase.v1.BackupB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132"
- + "\032.google.protobuf.FieldMaskB\003\340A\002\"G\n\020GetB"
+ + "to\"\377\003\n\006Backup\0226\n\010database\030\002 \001(\tB$\372A!\n\037sp"
+ + "anner.googleapis.com/Database\0220\n\014version"
+ + "_time\030\t \001(\0132\032.google.protobuf.Timestamp\022"
+ + "/\n\013expire_time\030\003 \001(\0132\032.google.protobuf.T"
+ + "imestamp\022\014\n\004name\030\001 \001(\t\0224\n\013create_time\030\004 "
+ + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\027\n\n"
+ + "size_bytes\030\005 \001(\003B\003\340A\003\022B\n\005state\030\006 \001(\0162..g"
+ + "oogle.spanner.admin.database.v1.Backup.S"
+ + "tateB\003\340A\003\022\"\n\025referencing_databases\030\007 \003(\t"
+ + "B\003\340A\003\"7\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n"
+ + "\010CREATING\020\001\022\t\n\005READY\020\002:\\\352AY\n\035spanner.goo"
+ + "gleapis.com/Backup\0228projects/{project}/i"
+ + "nstances/{instance}/backups/{backup}\"\245\001\n"
+ + "\023CreateBackupRequest\0227\n\006parent\030\001 \001(\tB\'\340A"
+ + "\002\372A!\n\037spanner.googleapis.com/Instance\022\026\n"
+ + "\tbackup_id\030\002 \001(\tB\003\340A\002\022=\n\006backup\030\003 \001(\0132(."
+ + "google.spanner.admin.database.v1.BackupB"
+ + "\003\340A\002\"\370\001\n\024CreateBackupMetadata\0220\n\004name\030\001 "
+ + "\001(\tB\"\372A\037\n\035spanner.googleapis.com/Backup\022"
+ + "6\n\010database\030\002 \001(\tB$\372A!\n\037spanner.googleap"
+ + "is.com/Database\022E\n\010progress\030\003 \001(\01323.goog"
+ + "le.spanner.admin.database.v1.OperationPr"
+ + "ogress\022/\n\013cancel_time\030\004 \001(\0132\032.google.pro"
+ + "tobuf.Timestamp\"\212\001\n\023UpdateBackupRequest\022"
+ + "=\n\006backup\030\001 \001(\0132(.google.spanner.admin.d"
+ + "atabase.v1.BackupB\003\340A\002\0224\n\013update_mask\030\002 "
+ + "\001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"G\n\020"
+ + "GetBackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035"
+ + "spanner.googleapis.com/Backup\"J\n\023DeleteB"
+ "ackupRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035span"
- + "ner.googleapis.com/Backup\"J\n\023DeleteBacku"
- + "pRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035spanner."
- + "googleapis.com/Backup\"\204\001\n\022ListBackupsReq"
- + "uest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.go"
- + "ogleapis.com/Instance\022\016\n\006filter\030\002 \001(\t\022\021\n"
- + "\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"i\n\023"
- + "ListBackupsResponse\0229\n\007backups\030\001 \003(\0132(.g"
- + "oogle.spanner.admin.database.v1.Backup\022\027"
- + "\n\017next_page_token\030\002 \001(\t\"\215\001\n\033ListBackupOp"
- + "erationsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n"
- + "\037spanner.googleapis.com/Instance\022\016\n\006filt"
- + "er\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_toke"
- + "n\030\004 \001(\t\"j\n\034ListBackupOperationsResponse\022"
- + "1\n\noperations\030\001 \003(\0132\035.google.longrunning"
- + ".Operation\022\027\n\017next_page_token\030\002 \001(\t\"f\n\nB"
- + "ackupInfo\022\016\n\006backup\030\001 \001(\t\022/\n\013create_time"
- + "\030\002 \001(\0132\032.google.protobuf.Timestamp\022\027\n\017so"
- + "urce_database\030\003 \001(\tB\377\001\n$com.google.spann"
- + "er.admin.database.v1B\013BackupProtoP\001ZHgoo"
- + "gle.golang.org/genproto/googleapis/spann"
- + "er/admin/database/v1;database\252\002&Google.C"
- + "loud.Spanner.Admin.Database.V1\312\002&Google\\"
- + "Cloud\\Spanner\\Admin\\Database\\V1\352\002+Google"
- + "::Cloud::Spanner::Admin::Database::V1b\006p"
- + "roto3"
+ + "ner.googleapis.com/Backup\"\204\001\n\022ListBackup"
+ + "sRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanne"
+ + "r.googleapis.com/Instance\022\016\n\006filter\030\002 \001("
+ + "\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t"
+ + "\"i\n\023ListBackupsResponse\0229\n\007backups\030\001 \003(\013"
+ + "2(.google.spanner.admin.database.v1.Back"
+ + "up\022\027\n\017next_page_token\030\002 \001(\t\"\215\001\n\033ListBack"
+ + "upOperationsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002"
+ + "\372A!\n\037spanner.googleapis.com/Instance\022\016\n\006"
+ + "filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_"
+ + "token\030\004 \001(\t\"j\n\034ListBackupOperationsRespo"
+ + "nse\0221\n\noperations\030\001 \003(\0132\035.google.longrun"
+ + "ning.Operation\022\027\n\017next_page_token\030\002 \001(\t\""
+ + "\342\001\n\nBackupInfo\0222\n\006backup\030\001 \001(\tB\"\372A\037\n\035spa"
+ + "nner.googleapis.com/Backup\0220\n\014version_ti"
+ + "me\030\004 \001(\0132\032.google.protobuf.Timestamp\022/\n\013"
+ + "create_time\030\002 \001(\0132\032.google.protobuf.Time"
+ + "stamp\022=\n\017source_database\030\003 \001(\tB$\372A!\n\037spa"
+ + "nner.googleapis.com/DatabaseB\377\001\n$com.goo"
+ + "gle.spanner.admin.database.v1B\013BackupPro"
+ + "toP\001ZHgoogle.golang.org/genproto/googlea"
+ + "pis/spanner/admin/database/v1;database\252\002"
+ + "&Google.Cloud.Spanner.Admin.Database.V1\312"
+ + "\002&Google\\Cloud\\Spanner\\Admin\\Database\\V1"
+ + "\352\002+Google::Cloud::Spanner::Admin::Databa"
+ + "se::V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -158,6 +164,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
internal_static_google_spanner_admin_database_v1_Backup_descriptor,
new java.lang.String[] {
"Database",
+ "VersionTime",
"ExpireTime",
"Name",
"CreateTime",
@@ -243,7 +250,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_spanner_admin_database_v1_BackupInfo_descriptor,
new java.lang.String[] {
- "Backup", "CreateTime", "SourceDatabase",
+ "Backup", "VersionTime", "CreateTime", "SourceDatabase",
});
com.google.protobuf.ExtensionRegistry registry =
com.google.protobuf.ExtensionRegistry.newInstance();
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java
index a1b0cc35124..c4e23c96e69 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java
@@ -161,7 +161,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -184,7 +184,7 @@ public java.lang.String getName() {
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -210,7 +210,7 @@ public com.google.protobuf.ByteString getNameBytes() {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return The database.
*/
@@ -233,7 +233,7 @@ public java.lang.String getDatabase() {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for database.
*/
@@ -777,7 +777,7 @@ public Builder mergeFrom(
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -799,7 +799,7 @@ public java.lang.String getName() {
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -821,7 +821,7 @@ public com.google.protobuf.ByteString getNameBytes() {
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The name to set.
* @return This builder for chaining.
@@ -842,7 +842,7 @@ public Builder setName(java.lang.String value) {
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return This builder for chaining.
*/
@@ -859,7 +859,7 @@ public Builder clearName() {
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The bytes for name to set.
* @return This builder for chaining.
@@ -883,7 +883,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return The database.
*/
@@ -905,7 +905,7 @@ public java.lang.String getDatabase() {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for database.
*/
@@ -927,7 +927,7 @@ public com.google.protobuf.ByteString getDatabaseBytes() {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @param value The database to set.
* @return This builder for chaining.
@@ -948,7 +948,7 @@ public Builder setDatabase(java.lang.String value) {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return This builder for chaining.
*/
@@ -965,7 +965,7 @@ public Builder clearDatabase() {
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @param value The bytes for database to set.
* @return This builder for chaining.
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java
index 5034e3af02d..fcb89c03472 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java
@@ -30,7 +30,7 @@ public interface CreateBackupMetadataOrBuilder
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -42,7 +42,7 @@ public interface CreateBackupMetadataOrBuilder
* The name of the backup being created.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -55,7 +55,7 @@ public interface CreateBackupMetadataOrBuilder
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return The database.
*/
@@ -67,7 +67,7 @@ public interface CreateBackupMetadataOrBuilder
* The name of the database the backup is created from.
*
*
- * string database = 2;
+ * string database = 2 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for database.
*/
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
index 768f470254d..f4c866c8f85 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
@@ -40,6 +40,7 @@ private Database(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
private Database() {
name_ = "";
state_ = 0;
+ versionRetentionPeriod_ = "";
}
@java.lang.Override
@@ -114,6 +115,28 @@ private Database(
restoreInfo_ = subBuilder.buildPartial();
}
+ break;
+ }
+ case 50:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ versionRetentionPeriod_ = s;
+ break;
+ }
+ case 58:
+ {
+ com.google.protobuf.Timestamp.Builder subBuilder = null;
+ if (earliestVersionTime_ != null) {
+ subBuilder = earliestVersionTime_.toBuilder();
+ }
+ earliestVersionTime_ =
+ input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(earliestVersionTime_);
+ earliestVersionTime_ = subBuilder.buildPartial();
+ }
+
break;
}
default:
@@ -548,6 +571,120 @@ public com.google.spanner.admin.database.v1.RestoreInfoOrBuilder getRestoreInfoO
return getRestoreInfo();
}
+ public static final int VERSION_RETENTION_PERIOD_FIELD_NUMBER = 6;
+ private volatile java.lang.Object versionRetentionPeriod_;
+ /**
+ *
+ *
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ *
+ * string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ *
+ * @param value The versionRetentionPeriod to set.
+ * @return This builder for chaining.
+ */
+ public Builder setVersionRetentionPeriod(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ versionRetentionPeriod_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ *
+ * string version_retention_period = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ *
+ * @param value The bytes for versionRetentionPeriod to set.
+ * @return This builder for chaining.
+ */
+ public Builder setVersionRetentionPeriodBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ versionRetentionPeriod_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.Timestamp earliestVersionTime_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ earliestVersionTimeBuilder_;
+ /**
+ *
+ *
+ *
+ * Output only. Earliest timestamp at which older versions of the data can be
+ * read.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
+ * Output only. The period in which Cloud Spanner retains all versions of data
+ * for the database. This is the same as the value of version_retention_period
+ * database option set using
+ * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ * if not set.
+ *
* Required. The database whose schema we wish to get.
+ * Values are of the form
+ * `projects/<project>/instances/<instance>/databases/<database>`
*
*
*
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java
index baea7c8f1ff..a49ee408beb 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java
@@ -218,9 +218,9 @@ public com.google.protobuf.ByteString getParentBytes() {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -272,9 +272,9 @@ public java.lang.String getFilter() {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -894,9 +894,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -947,9 +947,9 @@ public java.lang.String getFilter() {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -1000,9 +1000,9 @@ public com.google.protobuf.ByteString getFilterBytes() {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -1052,9 +1052,9 @@ public Builder setFilter(java.lang.String value) {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -1100,9 +1100,9 @@ public Builder clearFilter() {
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java
index 4f43eba2884..6d48d7f5f3f 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java
@@ -82,9 +82,9 @@ public interface ListBackupOperationsRequestOrBuilder
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
@@ -125,9 +125,9 @@ public interface ListBackupOperationsRequestOrBuilder
* * `done:true` - The operation is complete.
* * `metadata.database:prod` - The database the backup was taken from has
* a name containing the string "prod".
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
- * `(metadata.name:howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ * `(metadata.name:howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Returns operations where:
* * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
* * The backup name contains the string "howl".
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java
index 06cff39b688..d59caa1f7de 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java
@@ -216,11 +216,11 @@ public com.google.protobuf.ByteString getParentBytes() {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -272,11 +272,11 @@ public java.lang.String getFilter() {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -900,11 +900,11 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -955,11 +955,11 @@ public java.lang.String getFilter() {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -1010,11 +1010,11 @@ public com.google.protobuf.ByteString getFilterBytes() {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -1064,11 +1064,11 @@ public Builder setFilter(java.lang.String value) {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -1114,11 +1114,11 @@ public Builder clearFilter() {
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java
index 115dcd7551a..38eb5693e1a 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java
@@ -80,11 +80,11 @@ public interface ListDatabaseOperationsRequestOrBuilder
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
@@ -125,11 +125,11 @@ public interface ListDatabaseOperationsRequestOrBuilder
* you can specify AND, OR, and NOT logic explicitly.
* Here are a few examples:
* * `done:true` - The operation is complete.
- * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
- * `(metadata.source_type:BACKUP) AND` <br/>
- * `(metadata.backup_info.backup:backup_howl) AND` <br/>
- * `(metadata.name:restored_howl) AND` <br/>
- * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ * `(metadata.source_type:BACKUP) AND` \
+ * `(metadata.backup_info.backup:backup_howl) AND` \
+ * `(metadata.name:restored_howl) AND` \
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
* `(error:*)` - Return operations where:
* * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
* * The database is restored from a backup.
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java
index 88c49cdc159..6bdf68bc71c 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java
@@ -141,7 +141,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -164,7 +164,7 @@ public java.lang.String getName() {
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -595,7 +595,7 @@ public Builder mergeFrom(
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -617,7 +617,7 @@ public java.lang.String getName() {
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -639,7 +639,7 @@ public com.google.protobuf.ByteString getNameBytes() {
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The name to set.
* @return This builder for chaining.
@@ -660,7 +660,7 @@ public Builder setName(java.lang.String value) {
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return This builder for chaining.
*/
@@ -677,7 +677,7 @@ public Builder clearName() {
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The bytes for name to set.
* @return This builder for chaining.
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java
index a5a211d446b..0606518a011 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java
@@ -30,7 +30,7 @@ public interface OptimizeRestoredDatabaseMetadataOrBuilder
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -42,7 +42,7 @@ public interface OptimizeRestoredDatabaseMetadataOrBuilder
* Name of the restored database being optimized.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java
index 4cb99151034..8a849d56711 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java
@@ -230,7 +230,7 @@ public SourceInfoCase getSourceInfoCase() {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -253,7 +253,7 @@ public java.lang.String getName() {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -1039,7 +1039,7 @@ public Builder clearSourceInfo() {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -1061,7 +1061,7 @@ public java.lang.String getName() {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
@@ -1083,7 +1083,7 @@ public com.google.protobuf.ByteString getNameBytes() {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The name to set.
* @return This builder for chaining.
@@ -1104,7 +1104,7 @@ public Builder setName(java.lang.String value) {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return This builder for chaining.
*/
@@ -1121,7 +1121,7 @@ public Builder clearName() {
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @param value The bytes for name to set.
* @return This builder for chaining.
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java
index 8d05e8b6b7c..35ad6d76e9d 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java
@@ -30,7 +30,7 @@ public interface RestoreDatabaseMetadataOrBuilder
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The name.
*/
@@ -42,7 +42,7 @@ public interface RestoreDatabaseMetadataOrBuilder
* Name of the database being created and restored to.
*
*
- * string name = 1;
+ * string name = 1 [(.google.api.resource_reference) = { ... }
*
* @return The bytes for name.
*/
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
index 032a813e29b..7b981be4f45 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
@@ -120,176 +120,181 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "admin.database.v1.RestoreSourceType\022C\n\013b"
+ "ackup_info\030\002 \001(\0132,.google.spanner.admin."
+ "database.v1.BackupInfoH\000B\r\n\013source_info\""
- + "\226\003\n\010Database\022\021\n\004name\030\001 \001(\tB\003\340A\002\022D\n\005state"
+ + "\375\003\n\010Database\022\021\n\004name\030\001 \001(\tB\003\340A\002\022D\n\005state"
+ "\030\002 \001(\01620.google.spanner.admin.database.v"
+ "1.Database.StateB\003\340A\003\0224\n\013create_time\030\003 \001"
+ "(\0132\032.google.protobuf.TimestampB\003\340A\003\022H\n\014r"
+ "estore_info\030\004 \001(\0132-.google.spanner.admin"
- + ".database.v1.RestoreInfoB\003\340A\003\"M\n\005State\022\025"
- + "\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005R"
- + "EADY\020\002\022\024\n\020READY_OPTIMIZING\020\003:b\352A_\n\037spann"
- + "er.googleapis.com/Database\022\202\323\344\223"
- + "\002/\022-/v1/{parent=projects/*/instances/*}/"
- + "databases\332A\006parent\022\244\002\n\016CreateDatabase\0227."
- + "google.spanner.admin.database.v1.CreateD"
- + "atabaseRequest\032\035.google.longrunning.Oper"
- + "ation\"\271\001\202\323\344\223\0022\"-/v1/{parent=projects/*/i"
- + "nstances/*}/databases:\001*\332A\027parent,create"
- + "_statement\312Ad\n)google.spanner.admin.data"
- + "base.v1.Database\0227google.spanner.admin.d"
- + "atabase.v1.CreateDatabaseMetadata\022\255\001\n\013Ge"
- + "tDatabase\0224.google.spanner.admin.databas"
- + "e.v1.GetDatabaseRequest\032*.google.spanner"
- + ".admin.database.v1.Database\"<\202\323\344\223\002/\022-/v1"
- + "/{name=projects/*/instances/*/databases/"
- + "*}\332A\004name\022\235\002\n\021UpdateDatabaseDdl\022:.google"
- + ".spanner.admin.database.v1.UpdateDatabas"
- + "eDdlRequest\032\035.google.longrunning.Operati"
- + "on\"\254\001\202\323\344\223\002:25/v1/{database=projects/*/in"
- + "stances/*/databases/*}/ddl:\001*\332A\023database"
- + ",statements\312AS\n\025google.protobuf.Empty\022:g"
- + "oogle.spanner.admin.database.v1.UpdateDa"
- + "tabaseDdlMetadata\022\243\001\n\014DropDatabase\0225.goo"
- + "gle.spanner.admin.database.v1.DropDataba"
- + "seRequest\032\026.google.protobuf.Empty\"D\202\323\344\223\002"
- + "3*1/v1/{database=projects/*/instances/*/"
- + "databases/*}\332A\010database\022\315\001\n\016GetDatabaseD"
- + "dl\0227.google.spanner.admin.database.v1.Ge"
- + "tDatabaseDdlRequest\0328.google.spanner.adm"
- + "in.database.v1.GetDatabaseDdlResponse\"H\202"
- + "\323\344\223\0027\0225/v1/{database=projects/*/instance"
- + "s/*/databases/*}/ddl\332A\010database\022\353\001\n\014SetI"
- + "amPolicy\022\".google.iam.v1.SetIamPolicyReq"
- + "uest\032\025.google.iam.v1.Policy\"\237\001\202\323\344\223\002\206\001\">/"
- + "v1/{resource=projects/*/instances/*/data"
- + "bases/*}:setIamPolicy:\001*ZA\"/v1"
- + "/{resource=projects/*/instances/*/databa"
- + "ses/*}:getIamPolicy:\001*ZA\".google.spanner.admi"
- + "n.database.v1.ListBackupOperationsRespon"
- + "se\"E\202\323\344\223\0026\0224/v1/{parent=projects/*/insta"
- + "nces/*}/backupOperations\332A\006parent\032x\312A\026sp"
- + "anner.googleapis.com\322A\\https://www.googl"
- + "eapis.com/auth/cloud-platform,https://ww"
- + "w.googleapis.com/auth/spanner.adminB\332\002\n$"
- + "com.google.spanner.admin.database.v1B\031Sp"
- + "annerDatabaseAdminProtoP\001ZHgoogle.golang"
- + ".org/genproto/googleapis/spanner/admin/d"
- + "atabase/v1;database\252\002&Google.Cloud.Spann"
- + "er.Admin.Database.V1\312\002&Google\\Cloud\\Span"
- + "ner\\Admin\\Database\\V1\352\002+Google::Cloud::S"
- + "panner::Admin::Database::V1\352AJ\n\037spanner."
- + "googleapis.com/Instance\022\'projects/{proje"
- + "ct}/instances/{instance}b\006proto3"
+ + ".database.v1.RestoreInfoB\003\340A\003\022%\n\030version"
+ + "_retention_period\030\006 \001(\tB\003\340A\003\022>\n\025earliest"
+ + "_version_time\030\007 \001(\0132\032.google.protobuf.Ti"
+ + "mestampB\003\340A\003\"M\n\005State\022\025\n\021STATE_UNSPECIFI"
+ + "ED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\024\n\020READY_O"
+ + "PTIMIZING\020\003:b\352A_\n\037spanner.googleapis.com"
+ + "/Database\022\202\323\344\223\002/\022-/v1/{parent=proj"
+ + "ects/*/instances/*}/databases\332A\006parent\022\244"
+ + "\002\n\016CreateDatabase\0227.google.spanner.admin"
+ + ".database.v1.CreateDatabaseRequest\032\035.goo"
+ + "gle.longrunning.Operation\"\271\001\202\323\344\223\0022\"-/v1/"
+ + "{parent=projects/*/instances/*}/database"
+ + "s:\001*\332A\027parent,create_statement\312Ad\n)googl"
+ + "e.spanner.admin.database.v1.Database\0227go"
+ + "ogle.spanner.admin.database.v1.CreateDat"
+ + "abaseMetadata\022\255\001\n\013GetDatabase\0224.google.s"
+ + "panner.admin.database.v1.GetDatabaseRequ"
+ + "est\032*.google.spanner.admin.database.v1.D"
+ + "atabase\"<\202\323\344\223\002/\022-/v1/{name=projects/*/in"
+ + "stances/*/databases/*}\332A\004name\022\235\002\n\021Update"
+ + "DatabaseDdl\022:.google.spanner.admin.datab"
+ + "ase.v1.UpdateDatabaseDdlRequest\032\035.google"
+ + ".longrunning.Operation\"\254\001\202\323\344\223\002:25/v1/{da"
+ + "tabase=projects/*/instances/*/databases/"
+ + "*}/ddl:\001*\332A\023database,statements\312AS\n\025goog"
+ + "le.protobuf.Empty\022:google.spanner.admin."
+ + "database.v1.UpdateDatabaseDdlMetadata\022\243\001"
+ + "\n\014DropDatabase\0225.google.spanner.admin.da"
+ + "tabase.v1.DropDatabaseRequest\032\026.google.p"
+ + "rotobuf.Empty\"D\202\323\344\223\0023*1/v1/{database=pro"
+ + "jects/*/instances/*/databases/*}\332A\010datab"
+ + "ase\022\315\001\n\016GetDatabaseDdl\0227.google.spanner."
+ + "admin.database.v1.GetDatabaseDdlRequest\032"
+ + "8.google.spanner.admin.database.v1.GetDa"
+ + "tabaseDdlResponse\"H\202\323\344\223\0027\0225/v1/{database"
+ + "=projects/*/instances/*/databases/*}/ddl"
+ + "\332A\010database\022\353\001\n\014SetIamPolicy\022\".google.ia"
+ + "m.v1.SetIamPolicyRequest\032\025.google.iam.v1"
+ + ".Policy\"\237\001\202\323\344\223\002\206\001\">/v1/{resource=project"
+ + "s/*/instances/*/databases/*}:setIamPolic"
+ + "y:\001*ZA\"/v1/{resource=projects/"
+ + "*/instances/*/databases/*}:getIamPolicy:"
+ + "\001*ZA\""
+ + ".google.spanner.admin.database.v1.ListBa"
+ + "ckupOperationsResponse\"E\202\323\344\223\0026\0224/v1/{par"
+ + "ent=projects/*/instances/*}/backupOperat"
+ + "ions\332A\006parent\032x\312A\026spanner.googleapis.com"
+ + "\322A\\https://www.googleapis.com/auth/cloud"
+ + "-platform,https://www.googleapis.com/aut"
+ + "h/spanner.adminB\332\002\n$com.google.spanner.a"
+ + "dmin.database.v1B\031SpannerDatabaseAdminPr"
+ + "otoP\001ZHgoogle.golang.org/genproto/google"
+ + "apis/spanner/admin/database/v1;database\252"
+ + "\002&Google.Cloud.Spanner.Admin.Database.V1"
+ + "\312\002&Google\\Cloud\\Spanner\\Admin\\Database\\V"
+ + "1\352\002+Google::Cloud::Spanner::Admin::Datab"
+ + "ase::V1\352AJ\n\037spanner.googleapis.com/Insta"
+ + "nce\022\'projects/{project}/instances/{insta"
+ + "nce}b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -321,7 +326,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_spanner_admin_database_v1_Database_descriptor,
new java.lang.String[] {
- "Name", "State", "CreateTime", "RestoreInfo",
+ "Name",
+ "State",
+ "CreateTime",
+ "RestoreInfo",
+ "VersionRetentionPeriod",
+ "EarliestVersionTime",
});
internal_static_google_spanner_admin_database_v1_ListDatabasesRequest_descriptor =
getDescriptor().getMessageTypes().get(2);
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto
index e33faddddf4..a677207f729 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto
@@ -61,6 +61,12 @@ message Backup {
type: "spanner.googleapis.com/Database"
}];
+ // The backup will contain an externally consistent copy of the database at
+ // the timestamp specified by `version_time`. If `version_time` is not
+ // specified, the system will set `version_time` to the `create_time` of the
+ // backup.
+ google.protobuf.Timestamp version_time = 9;
+
// Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
// operation. The expiration time of the backup, with microseconds
// granularity that must be at least 6 hours and at most 366 days
@@ -84,10 +90,9 @@ message Backup {
// `projects//instances/`.
string name = 1;
- // Output only. The backup will contain an externally consistent
- // copy of the database at the timestamp specified by
- // `create_time`. `create_time` is approximately the time the
- // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
+ // Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
+ // request is received. If the request does not specify `version_time`, the
+ // `version_time` of the backup will be equivalent to the `create_time`.
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Size of the backup in bytes.
@@ -134,10 +139,14 @@ message CreateBackupRequest {
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
message CreateBackupMetadata {
// The name of the backup being created.
- string name = 1;
+ string name = 1 [(google.api.resource_reference) = {
+ type: "spanner.googleapis.com/Backup"
+ }];
// The name of the database the backup is created from.
- string database = 2;
+ string database = 2 [(google.api.resource_reference) = {
+ type: "spanner.googleapis.com/Database"
+ }];
// The progress of the
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
@@ -311,9 +320,9 @@ message ListBackupOperationsRequest {
// * `done:true` - The operation is complete.
// * `metadata.database:prod` - The database the backup was taken from has
// a name containing the string "prod".
- // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`
- // `(metadata.name:howl) AND`
- // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
+ // `(metadata.name:howl) AND` \
+ // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
// `(error:*)` - Returns operations where:
// * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
// * The backup name contains the string "howl".
@@ -355,12 +364,23 @@ message ListBackupOperationsResponse {
// Information about a backup.
message BackupInfo {
// Name of the backup.
- string backup = 1;
+ string backup = 1 [(google.api.resource_reference) = {
+ type: "spanner.googleapis.com/Backup"
+ }];
// The backup contains an externally consistent copy of `source_database` at
- // the timestamp specified by `create_time`.
+ // the timestamp specified by `version_time`. If the
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
+ // `version_time`, the `version_time` of the backup is equivalent to the
+ // `create_time`.
+ google.protobuf.Timestamp version_time = 4;
+
+ // The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
+ // received.
google.protobuf.Timestamp create_time = 2;
// Name of the database the backup was created from.
- string source_database = 3;
+ string source_database = 3 [(google.api.resource_reference) = {
+ type: "spanner.googleapis.com/Database"
+ }];
}
diff --git a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
index db6192bc026..12e751bd672 100644
--- a/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
+++ b/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
@@ -368,6 +368,17 @@ message Database {
// Output only. Applicable only for restored databases. Contains information
// about the restore source.
RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Output only. The period in which Cloud Spanner retains all versions of data
+ // for the database. This is the same as the value of version_retention_period
+ // database option set using
+ // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
+ // if not set.
+ string version_retention_period = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Output only. Earliest timestamp at which older versions of the data can be
+ // read.
+ google.protobuf.Timestamp earliest_version_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
@@ -535,6 +546,8 @@ message DropDatabaseRequest {
// The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
message GetDatabaseDdlRequest {
// Required. The database whose schema we wish to get.
+ // Values are of the form
+ // `projects//instances//databases/`
string database = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -590,11 +603,11 @@ message ListDatabaseOperationsRequest {
// Here are a few examples:
//
// * `done:true` - The operation is complete.
- // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND`
- // `(metadata.source_type:BACKUP) AND`
- // `(metadata.backup_info.backup:backup_howl) AND`
- // `(metadata.name:restored_howl) AND`
- // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
+ // `(metadata.source_type:BACKUP) AND` \
+ // `(metadata.backup_info.backup:backup_howl) AND` \
+ // `(metadata.name:restored_howl) AND` \
+ // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
// `(error:*)` - Return operations where:
// * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
// * The database is restored from a backup.
@@ -666,7 +679,9 @@ message RestoreDatabaseRequest {
// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
message RestoreDatabaseMetadata {
// Name of the database being created and restored to.
- string name = 1;
+ string name = 1 [(google.api.resource_reference) = {
+ type: "spanner.googleapis.com/Database"
+ }];
// The type of the restore source.
RestoreSourceType source_type = 2;
@@ -716,7 +731,9 @@ message RestoreDatabaseMetadata {
// completion of a database restore, and cannot be cancelled.
message OptimizeRestoredDatabaseMetadata {
// Name of the restored database being optimized.
- string name = 1;
+ string name = 1 [(google.api.resource_reference) = {
+ type: "spanner.googleapis.com/Database"
+ }];
// The progress of the post-restore optimizations.
OperationProgress progress = 2;
diff --git a/synth.metadata b/synth.metadata
index d9eb2060851..383b16ed68b 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -11,8 +11,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "8fa381b7138f1d72966ff20563efae1b2194d359",
- "internalRef": "353145174"
+ "sha": "30eb779ddcc4f389df34d0802d081ef6c4559d6d",
+ "internalRef": "354462069"
}
},
{
From 61ea2b940cadab8952900b3465ac5bf24f1c47f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Mon, 1 Feb 2021 11:06:03 +0100
Subject: [PATCH 19/42] test: reduce wait time for BackendExhaustedTest (#835)
The BackendExhaustedTest deliberately causes requests to get stuck on the mock server. This causes the Spanner instance to refuse to shutdown nicely and causes it to wait for 10 seconds. This can be circumvented by using shutdownNow() to force the closure of all gRPC transport channels. This reduces the overall build time with approx 10 seconds.
---
.../com/google/cloud/spanner/SpannerImpl.java | 7 ++++++-
.../cloud/spanner/spi/v1/GapicSpannerRpc.java | 16 ++++++++++++++++
.../cloud/spanner/BackendExhaustedTest.java | 3 +--
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java
index 2d034eda883..9fa8b30be28 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java
@@ -25,6 +25,7 @@
import com.google.cloud.grpc.GrpcTransportOptions;
import com.google.cloud.spanner.SessionClient.SessionId;
import com.google.cloud.spanner.SpannerOptions.CloseableExecutorProvider;
+import com.google.cloud.spanner.spi.v1.GapicSpannerRpc;
import com.google.cloud.spanner.spi.v1.SpannerRpc;
import com.google.cloud.spanner.spi.v1.SpannerRpc.Paginated;
import com.google.common.annotations.VisibleForTesting;
@@ -269,7 +270,11 @@ void close(long timeout, TimeUnit unit) {
sessionClients.clear();
asyncExecutorProvider.close();
try {
- gapicRpc.shutdown();
+ if (timeout == Long.MAX_VALUE || !(gapicRpc instanceof GapicSpannerRpc)) {
+ gapicRpc.shutdown();
+ } else {
+ ((GapicSpannerRpc) gapicRpc).shutdownNow();
+ }
} catch (RuntimeException e) {
logger.log(Level.WARNING, "Failed to close channels", e);
}
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
index 5172fe448fb..807eac6f11b 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
@@ -1718,6 +1718,22 @@ public void shutdown() {
}
}
+ public void shutdownNow() {
+ this.rpcIsClosed = true;
+ this.spannerStub.close();
+ this.partitionedDmlStub.close();
+ this.instanceAdminStub.close();
+ this.databaseAdminStub.close();
+ this.spannerWatchdog.shutdown();
+ this.executorProvider.shutdown();
+
+ this.spannerStub.shutdownNow();
+ this.partitionedDmlStub.shutdownNow();
+ this.instanceAdminStub.shutdownNow();
+ this.databaseAdminStub.shutdownNow();
+ this.spannerWatchdog.shutdownNow();
+ }
+
@Override
public boolean isClosed() {
return rpcIsClosed;
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BackendExhaustedTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BackendExhaustedTest.java
index cb1244f8e3e..7e4e41facc0 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BackendExhaustedTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BackendExhaustedTest.java
@@ -136,7 +136,6 @@ public void setUp() throws Exception {
SessionPoolOptions.newBuilder()
.setMinSessions(executor.getCorePoolSize())
.setMaxSessions(executor.getCorePoolSize() * 3)
- .setWriteSessionsFraction(0.0f)
.build())
.build();
executorFactory.release(executor);
@@ -159,7 +158,7 @@ public void tearDown() {
// This test case force-closes the Spanner instance as it would otherwise wait
// forever on the BatchCreateSessions requests that are 'stuck'.
try {
- ((SpannerImpl) spanner).close(100L, TimeUnit.MILLISECONDS);
+ ((SpannerImpl) spanner).close(10L, TimeUnit.MILLISECONDS);
} catch (SpannerException e) {
// ignore any errors during close as they are expected.
}
From 1c4eead835c455b9bb04dc3d0aab7a230375760e Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Mon, 1 Feb 2021 19:02:15 -0800
Subject: [PATCH 20/42] build: migrate to flakybot (#839)
Source-Author: Justin Beckwith
Source-Date: Thu Jan 28 22:22:38 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: d1bb9173100f62c0cfc8f3138b62241e7f47ca6a
Source-Link: https://github.com/googleapis/synthtool/commit/d1bb9173100f62c0cfc8f3138b62241e7f47ca6a
---
.kokoro/build.sh | 4 ++--
synth.metadata | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 8280d10ad67..4572da72d57 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -110,8 +110,8 @@ bash .kokoro/coerce_logs.sh
if [[ "${ENABLE_BUILD_COP}" == "true" ]]
then
- chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop
- ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-spanner
+ chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot
+ ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-spanner
fi
echo "exiting with ${RETURN_CODE}"
diff --git a/synth.metadata b/synth.metadata
index 383b16ed68b..3ab9fe79bde 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "facda8a7d07a9cf08b1847678b24b270f1abdb38"
+ "sha": "004c5d759804a380e65d1023faef0978de5d3ff9"
}
},
{
@@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
- "sha": "3816b080296d4d52975079fd26c110dd26ba25af"
+ "sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
}
}
],
From 77b7cfcd1b2cc4825e226f219900f8eab29732df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Tue, 2 Feb 2021 04:24:24 +0100
Subject: [PATCH 21/42] test: suppress logging a known warning (#841)
---
.../cloud/spanner/connection/SpannerPoolTest.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
index 19d6dfddcde..9174ef81b22 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
@@ -169,6 +169,7 @@ public void testRemoveConnection() {
private static Logger log = Logger.getLogger(SpannerPool.class.getName());
private static OutputStream logCapturingStream;
private static StreamHandler customLogHandler;
+ private static boolean useParentHandlers;
private void attachLogCapturer() {
logCapturingStream = new ByteArrayOutputStream();
@@ -182,14 +183,23 @@ private void attachLogCapturer() {
throw new IllegalStateException("no handlers found for logger");
}
customLogHandler = new StreamHandler(logCapturingStream, handlers[0].getFormatter());
+ useParentHandlers = log.getUseParentHandlers();
+ log.setUseParentHandlers(false);
log.addHandler(customLogHandler);
}
- public String getTestCapturedLog() {
+ private String getTestCapturedLog() {
customLogHandler.flush();
return logCapturingStream.toString();
}
+ @AfterClass
+ public static void resetUseParentHandlers() {
+ if (useParentHandlers) {
+ log.setUseParentHandlers(true);
+ }
+ }
+
@Test
public void testRemoveConnectionOptionsNotRegistered() {
attachLogCapturer();
From 118d1b31f5f7771023766fd72a8229db80f1f5a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Tue, 2 Feb 2021 04:28:36 +0100
Subject: [PATCH 22/42] fix: make compiled statements immutable (#843)
---
.../ClientSideStatementExecutor.java | 13 -------------
.../connection/ClientSideStatementImpl.java | 11 +++++++----
.../ClientSideStatementNoParamExecutor.java | 14 +++++++++-----
.../ClientSideStatementSetExecutor.java | 18 ++++++++++++------
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementExecutor.java
index 24681939187..7ec09766697 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementExecutor.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementExecutor.java
@@ -16,8 +16,6 @@
package com.google.cloud.spanner.connection;
-import com.google.cloud.spanner.connection.ClientSideStatementImpl.CompileException;
-
/**
* A {@link ClientSideStatementExecutor} is used to compile {@link ClientSideStatement}s from the
* json source file, and to execute these against a {@link Connection} (through a {@link
@@ -25,17 +23,6 @@
*/
interface ClientSideStatementExecutor {
- /**
- * Compiles the given {@link ClientSideStatementImpl} and registers this statement with this
- * executor. A statement must be compiled before it can be executed. The parser automatically
- * compiles all available statements during initialization.
- *
- * @param statement The statement to compile.
- * @throws CompileException If the statement could not be compiled. This should never happen, as
- * it would indicate that an invalid statement has been defined in the source file.
- */
- void compile(ClientSideStatementImpl statement) throws CompileException;
-
/**
* Executes the {@link ClientSideStatementImpl} that has been compiled and registered with this
* executor on the specified connection.
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementImpl.java
index 7621a0ced5c..e9c9c1654e9 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementImpl.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementImpl.java
@@ -19,6 +19,7 @@
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.connection.StatementResult.ResultType;
import com.google.common.base.Preconditions;
+import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.List;
@@ -143,10 +144,12 @@ public String getMessage() {
ClientSideStatementImpl compile() throws CompileException {
try {
this.pattern = Pattern.compile(regex);
- this.executor =
- (ClientSideStatementExecutor)
- Class.forName(getClass().getPackage().getName() + "." + executorName).newInstance();
- this.executor.compile(this);
+ @SuppressWarnings("unchecked")
+ Constructor constructor =
+ (Constructor)
+ Class.forName(getClass().getPackage().getName() + "." + executorName)
+ .getDeclaredConstructor(ClientSideStatementImpl.class);
+ this.executor = constructor.newInstance(this);
return this;
} catch (Exception e) {
throw new CompileException(e, this);
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementNoParamExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementNoParamExecutor.java
index 4c31e3e28d2..6f5e683ce64 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementNoParamExecutor.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementNoParamExecutor.java
@@ -24,12 +24,16 @@
* SHOW AUTOCOMMIT. The executor just calls a method with no parameters.
*/
class ClientSideStatementNoParamExecutor implements ClientSideStatementExecutor {
- private Method method;
+ private final Method method;
- ClientSideStatementNoParamExecutor() {}
-
- @Override
- public void compile(ClientSideStatementImpl statement) throws CompileException {
+ /**
+ * Creates and compiles the given {@link ClientSideStatementImpl}.
+ *
+ * @param statement The statement to compile.
+ * @throws CompileException If the statement could not be compiled. This should never happen, as
+ * it would indicate that an invalid statement has been defined in the source file.
+ */
+ ClientSideStatementNoParamExecutor(ClientSideStatementImpl statement) throws CompileException {
try {
this.method = ConnectionStatementExecutor.class.getDeclaredMethod(statement.getMethodName());
} catch (NoSuchMethodException | SecurityException e) {
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java
index 54765282f5c..4f4fe140428 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java
@@ -30,14 +30,20 @@
* AUTOCOMMIT=TRUE.
*/
class ClientSideStatementSetExecutor implements ClientSideStatementExecutor {
- private ClientSideStatementImpl statement;
- private Method method;
- private ClientSideStatementValueConverter converter;
- private Pattern allowedValuesPattern;
+ private final ClientSideStatementImpl statement;
+ private final Method method;
+ private final ClientSideStatementValueConverter converter;
+ private final Pattern allowedValuesPattern;
+ /**
+ * Creates and compiles the given {@link ClientSideStatementImpl}.
+ *
+ * @param statement The statement to compile.
+ * @throws CompileException If the statement could not be compiled. This should never happen, as
+ * it would indicate that an invalid statement has been defined in the source file.
+ */
@SuppressWarnings("unchecked")
- @Override
- public void compile(ClientSideStatementImpl statement) throws CompileException {
+ ClientSideStatementSetExecutor(ClientSideStatementImpl statement) throws CompileException {
Preconditions.checkNotNull(statement.getSetStatement());
try {
this.statement = statement;
From 2c745f31288d5f6ad501b5542ea01db72e015d1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Tue, 2 Feb 2021 04:29:16 +0100
Subject: [PATCH 23/42] cleanup: return instead of fallthrough + improve
comment (#844)
Return the TransactionSelector that is built instead of falling through to the end of
the method. The behavior does not change by this, but it makes it easier to read and
understand the code.
Fixes #830
---
.../java/com/google/cloud/spanner/TransactionRunnerImpl.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
index c3973c1807d..a4973c29345 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
@@ -463,7 +463,10 @@ TransactionSelector getTransactionSelector() {
// Aborted error if the call that included the BeginTransaction option fails. The
// Aborted error will cause the entire transaction to be retried, and the retry will use
// a separate BeginTransaction RPC.
- TransactionSelector.newBuilder()
+ // If tx.get() returns successfully, this.transactionId will also have been set to a
+ // valid value as the latter is always set when a transaction id is returned by a
+ // statement.
+ return TransactionSelector.newBuilder()
.setId(tx.get(waitForTransactionTimeoutMillis, TimeUnit.MILLISECONDS))
.build();
}
From f9ac29cd05e775c8ea17e0e227eb925df88a8dba Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Tue, 2 Feb 2021 14:12:03 -0800
Subject: [PATCH 24/42] build(java): generate docfx yml on release (#845)
This PR was generated using Autosynth. :rainbow:
Synth log will be available here:
https://source.cloud.google.com/results/invocations/6670e800-5ae0-42a0-9f59-45848d8d694a/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: https://github.com/googleapis/synthtool/commit/5de29e9434b63ea6d7e46dc348521c62969af1a1
---
.kokoro/release/publish_javadoc.cfg | 5 +--
.kokoro/release/publish_javadoc11.cfg | 30 +++++++++++++++
.kokoro/release/publish_javadoc11.sh | 55 +++++++++++++++++++++++++++
synth.metadata | 6 ++-
4 files changed, 90 insertions(+), 6 deletions(-)
create mode 100644 .kokoro/release/publish_javadoc11.cfg
create mode 100755 .kokoro/release/publish_javadoc11.sh
diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg
index e41d593e948..cbde2338f3d 100644
--- a/.kokoro/release/publish_javadoc.cfg
+++ b/.kokoro/release/publish_javadoc.cfg
@@ -26,7 +26,4 @@ before_action {
keyname: "docuploader_service_account"
}
}
-}
-
-# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/
-gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg
new file mode 100644
index 00000000000..2ddd71ce63e
--- /dev/null
+++ b/.kokoro/release/publish_javadoc11.cfg
@@ -0,0 +1,30 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "STAGING_BUCKET_V2"
+ value: "docs-staging-v2"
+ # Production will be at: docs-staging-v2
+}
+
+# Configure the docker image for kokoro-trampoline
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/java11"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/java-memcache/.kokoro/release/publish_javadoc11.sh"
+}
+
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73713
+ keyname: "docuploader_service_account"
+ }
+ }
+}
+
+# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"
\ No newline at end of file
diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh
new file mode 100755
index 00000000000..63af49cf0da
--- /dev/null
+++ b/.kokoro/release/publish_javadoc11.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# Copyright 2021 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+if [[ -z "${CREDENTIALS}" ]]; then
+ CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account
+fi
+
+if [[ -z "${STAGING_BUCKET_V2}" ]]; then
+ echo "Need to set STAGING_BUCKET_V2 environment variable"
+ exit 1
+fi
+
+# work from the git root directory
+pushd $(dirname "$0")/../../
+
+# install docuploader package
+python3 -m pip install gcp-docuploader
+
+# compile all packages
+mvn clean install -B -q -DskipTests=true
+
+export NAME=google-cloud-spanner
+export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
+
+# V3 generates docfx yml from javadoc
+# generate yml
+mvn clean site -B -q -P docFX
+
+pushd target/docfx-yml
+
+# create metadata
+python3 -m docuploader create-metadata \
+ --name ${NAME} \
+ --version ${VERSION} \
+ --language java
+
+# upload yml
+python3 -m docuploader upload . \
+ --credentials ${CREDENTIALS} \
+ --staging-bucket ${STAGING_BUCKET_V2} \
+ --destination-prefix docfx-
diff --git a/synth.metadata b/synth.metadata
index 3ab9fe79bde..7d46ad4dc0b 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "004c5d759804a380e65d1023faef0978de5d3ff9"
+ "sha": "2c745f31288d5f6ad501b5542ea01db72e015d1e"
}
},
{
@@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
- "sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
+ "sha": "5de29e9434b63ea6d7e46dc348521c62969af1a1"
}
}
],
@@ -102,6 +102,8 @@
".kokoro/release/promote.sh",
".kokoro/release/publish_javadoc.cfg",
".kokoro/release/publish_javadoc.sh",
+ ".kokoro/release/publish_javadoc11.cfg",
+ ".kokoro/release/publish_javadoc11.sh",
".kokoro/release/snapshot.cfg",
".kokoro/release/snapshot.sh",
".kokoro/release/stage.cfg",
From 2887bbb77141ddc92d8ef79d6221a041b4330999 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Thu, 4 Feb 2021 12:54:10 -0800
Subject: [PATCH 25/42] build(java): run linkage monitor as GitHub action
(#846)
This PR was generated using Autosynth. :rainbow:
Synth log will be available here:
https://source.cloud.google.com/results/invocations/5d05a436-b3b3-491d-bbf9-6b053be3c812/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: https://github.com/googleapis/synthtool/commit/e935c9ecb47da0f2e054f5f1845f7cf7c95fa625
---
.github/workflows/ci.yaml | 13 ++++++++++-
.kokoro/linkage-monitor.sh | 46 --------------------------------------
synth.metadata | 5 ++---
3 files changed, 14 insertions(+), 50 deletions(-)
delete mode 100755 .kokoro/linkage-monitor.sh
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 68302207566..98a472e132d 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -54,7 +54,18 @@ jobs:
with:
java-version: 8
- run: java -version
- - run: .kokoro/linkage-monitor.sh
+ - name: Install artifacts to local Maven repository
+ run: |
+ source .kokoro/common.sh
+ retry_with_backoff 3 10 \
+ mvn install -B -V \
+ -Dmaven.test.skip -DskipTests=true \
+ -Dclirr.skip=true \
+ -Denforcer.skip=true \
+ -Dmaven.javadoc.skip=true \
+ -Dgcloud.download.skip=true
+ shell: bash
+ - uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor
lint:
runs-on: ubuntu-latest
steps:
diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh
deleted file mode 100755
index 759ab4e2c22..00000000000
--- a/.kokoro/linkage-monitor.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-# Copyright 2019 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -eo pipefail
-# Display commands being run.
-set -x
-
-## Get the directory of the build script
-scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
-## cd to the parent directory, i.e. the root of the git repo
-cd ${scriptDir}/..
-
-# include common functions
-source ${scriptDir}/common.sh
-
-# Print out Java version
-java -version
-echo ${JOB_TYPE}
-
-# attempt to install 3 times with exponential backoff (starting with 10 seconds)
-retry_with_backoff 3 10 \
- mvn install -B -V \
- -DskipTests=true \
- -Dclirr.skip=true \
- -Denforcer.skip=true \
- -Dmaven.javadoc.skip=true \
- -Dgcloud.download.skip=true
-
-# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
-JAR=linkage-monitor-latest-all-deps.jar
-curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}"
-
-# Fails if there's new linkage errors compared with baseline
-java -jar ${JAR} com.google.cloud:libraries-bom
diff --git a/synth.metadata b/synth.metadata
index 7d46ad4dc0b..a25f31efdaa 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "2c745f31288d5f6ad501b5542ea01db72e015d1e"
+ "sha": "f9ac29cd05e775c8ea17e0e227eb925df88a8dba"
}
},
{
@@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
- "sha": "5de29e9434b63ea6d7e46dc348521c62969af1a1"
+ "sha": "e935c9ecb47da0f2e054f5f1845f7cf7c95fa625"
}
}
],
@@ -74,7 +74,6 @@
".kokoro/continuous/java8.cfg",
".kokoro/continuous/readme.cfg",
".kokoro/dependencies.sh",
- ".kokoro/linkage-monitor.sh",
".kokoro/nightly/integration.cfg",
".kokoro/nightly/java11.cfg",
".kokoro/nightly/java7.cfg",
From 1d5f71cd3c4fce60846bfaa8b055acffbc119810 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Thu, 4 Feb 2021 15:32:22 -0800
Subject: [PATCH 26/42] chore: Re-generated to pick up changes from synthtool.
(#851)
This PR was generated using Autosynth. :rainbow:
Synth log will be available here:
https://source.cloud.google.com/results/invocations/b107ca23-cc03-4d8e-82d2-0b35f1361777/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: https://github.com/googleapis/synthtool/commit/692715c0f23a7bb3bfbbaa300f7620ddfa8c47e5
Source-Link: https://github.com/googleapis/synthtool/commit/27b2d4f4674840628d0b75c5941e89c12af4764f
Source-Link: https://github.com/googleapis/synthtool/commit/140ba24a136c63e7f10a998a63e7898aed63ea7d
---
.github/workflows/auto-release.yaml | 2 +-
.kokoro/release/publish_javadoc11.cfg | 4 ++--
LICENSE | 1 -
synth.metadata | 4 ++--
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml
index 2b6cdbc976c..76e6404b4e0 100644
--- a/.github/workflows/auto-release.yaml
+++ b/.github/workflows/auto-release.yaml
@@ -17,7 +17,7 @@ jobs:
}
// only approve PRs like "chore: release "
- if ( !context.payload.pull_request.title.startsWith("chore: release") ) {
+ if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) {
return;
}
diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg
index 2ddd71ce63e..02cd9b1ccff 100644
--- a/.kokoro/release/publish_javadoc11.cfg
+++ b/.kokoro/release/publish_javadoc11.cfg
@@ -14,7 +14,7 @@ env_vars: {
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
- value: "github/java-memcache/.kokoro/release/publish_javadoc11.sh"
+ value: "github/java-spanner/.kokoro/release/publish_javadoc11.sh"
}
before_action {
@@ -27,4 +27,4 @@ before_action {
}
# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/
-gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"
\ No newline at end of file
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"
diff --git a/LICENSE b/LICENSE
index d6456956733..261eeb9e9f8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,3 @@
-
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
diff --git a/synth.metadata b/synth.metadata
index a25f31efdaa..7e28947f74e 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
- "sha": "f9ac29cd05e775c8ea17e0e227eb925df88a8dba"
+ "sha": "2887bbb77141ddc92d8ef79d6221a041b4330999"
}
},
{
@@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
- "sha": "e935c9ecb47da0f2e054f5f1845f7cf7c95fa625"
+ "sha": "692715c0f23a7bb3bfbbaa300f7620ddfa8c47e5"
}
}
],
From 58cebd85a9d82bd1526b9eae98892181f1a022f1 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Mon, 8 Feb 2021 03:12:52 +0100
Subject: [PATCH 27/42] deps: update dependency
com.google.cloud:google-cloud-monitoring to v2.0.12 (#854)
---
samples/install-without-bom/pom.xml | 2 +-
samples/snapshot/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 8658f8208b0..5373c065550 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -23,7 +23,7 @@
UTF-80.28.31.2.11
- 2.0.11
+ 2.0.12
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 93f5eff505b..e66974d9002 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -23,7 +23,7 @@
UTF-80.28.31.2.11
- 2.0.11
+ 2.0.12
From c451f86af5dade8653356bc30436199db9328061 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Tue, 9 Feb 2021 02:14:06 +0100
Subject: [PATCH 28/42] cleanup: remove unused transaction manager (#858)
The SingleUseTransaction in the Connection API previously used a
TransactionManager instead of a TransactionRunner, as this was the only way that it
was possible to implement a statement-specific timeout. This is now supported by the
client library, and the SingleUseTransaction had already been moved to using only a
TransactionRunner. There was however still an unused TransactionManager reference in
the code.
Fixes #852
---
.../spanner/connection/SingleUseTransaction.java | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SingleUseTransaction.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SingleUseTransaction.java
index 52011eb9100..edabb7f0177 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SingleUseTransaction.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SingleUseTransaction.java
@@ -33,7 +33,6 @@
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.TransactionContext;
-import com.google.cloud.spanner.TransactionManager;
import com.google.cloud.spanner.TransactionRunner;
import com.google.cloud.spanner.TransactionRunner.TransactionCallable;
import com.google.cloud.spanner.connection.StatementParser.ParsedStatement;
@@ -71,7 +70,6 @@ class SingleUseTransaction extends AbstractBaseUnitOfWork {
private final TimestampBound readOnlyStaleness;
private final AutocommitDmlMode autocommitDmlMode;
private volatile SettableApiFuture readTimestamp = null;
- private volatile TransactionManager txManager;
private volatile TransactionRunner writeTransaction;
private boolean used = false;
private volatile UnitOfWorkState state = UnitOfWorkState.STARTED;
@@ -221,29 +219,21 @@ public Timestamp getReadTimestampOrNull() {
}
private boolean hasCommitTimestamp() {
- return state == UnitOfWorkState.COMMITTED
- && (writeTransaction != null
- || (txManager != null
- && txManager.getState()
- == com.google.cloud.spanner.TransactionManager.TransactionState.COMMITTED));
+ return state == UnitOfWorkState.COMMITTED && writeTransaction != null;
}
@Override
public Timestamp getCommitTimestamp() {
ConnectionPreconditions.checkState(
hasCommitTimestamp(), "There is no commit timestamp available for this transaction.");
- return writeTransaction != null
- ? writeTransaction.getCommitTimestamp()
- : txManager.getCommitTimestamp();
+ return writeTransaction.getCommitTimestamp();
}
@Override
public Timestamp getCommitTimestampOrNull() {
if (hasCommitTimestamp()) {
try {
- return writeTransaction != null
- ? writeTransaction.getCommitTimestamp()
- : txManager.getCommitTimestamp();
+ return writeTransaction.getCommitTimestamp();
} catch (SpannerException e) {
// ignore
}
From c86fb5e24459f4d4b3d5c2ceda55c0bbe2cacabc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?=
Date: Tue, 9 Feb 2021 02:21:19 +0100
Subject: [PATCH 29/42] test: force-close to speed up timeout tests (#840)
* test: force-close to speed up timeout tests
* fix: mark connection as closed before waiting
* fix: set closed before shutting down
* cleanup: add test cases + remove unused code
---
.../spanner/connection/ConnectionImpl.java | 12 ++++--
.../cloud/spanner/connection/SpannerPool.java | 34 +++++++++++-----
.../spanner/connection/StatementExecutor.java | 8 ++++
.../spanner/ForceCloseSpannerFunction.java | 40 +++++++++++++++++++
.../connection/AbstractMockServerTest.java | 17 ++++++--
.../spanner/connection/SpannerPoolTest.java | 15 ++++---
6 files changed, 106 insertions(+), 20 deletions(-)
create mode 100644 google-cloud-spanner/src/test/java/com/google/cloud/spanner/ForceCloseSpannerFunction.java
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java
index b49adbf1245..0c91e8060e7 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java
@@ -259,11 +259,17 @@ public void close() {
// Ignore as we are closing the connection.
}
}
- statementExecutor.shutdownNow();
- spannerPool.removeConnection(options, this);
+ // Try to wait for the current statement to finish (if any) before we actually close the
+ // connection.
+ this.closed = true;
+ statementExecutor.shutdown();
leakedException = null;
+ spannerPool.removeConnection(options, this);
+ statementExecutor.awaitTermination(10L, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ // ignore and continue to close the connection.
} finally {
- this.closed = true;
+ statementExecutor.shutdownNow();
}
}
}
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java
index be5b16e393b..51bfde8f00e 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/SpannerPool.java
@@ -25,6 +25,7 @@
import com.google.cloud.spanner.SpannerExceptionFactory;
import com.google.cloud.spanner.SpannerOptions;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
@@ -62,6 +63,15 @@ public class SpannerPool {
private static final String CONNECTION_API_CLIENT_LIB_TOKEN = "sp-jdbc";
private static final Logger logger = Logger.getLogger(SpannerPool.class.getName());
+ private static final Function DEFAULT_CLOSE_FUNCTION =
+ new Function() {
+ @Override
+ public Void apply(Spanner spanner) {
+ spanner.close();
+ return null;
+ }
+ };
+
/**
* Closes the default {@link SpannerPool} and all {@link Spanner} instances that have been opened
* by connections and that are still open. Call this method at the end of your application to
@@ -395,6 +405,12 @@ void checkAndCloseSpanners() {
@VisibleForTesting
void checkAndCloseSpanners(CheckAndCloseSpannersMode mode) {
+ checkAndCloseSpanners(mode, DEFAULT_CLOSE_FUNCTION);
+ }
+
+ @VisibleForTesting
+ void checkAndCloseSpanners(
+ CheckAndCloseSpannersMode mode, Function closeSpannerFunction) {
List keysStillInUse = new ArrayList<>();
synchronized (this) {
for (Entry entry : spanners.entrySet()) {
@@ -416,7 +432,7 @@ void checkAndCloseSpanners(CheckAndCloseSpannersMode mode) {
// Force close all Spanner instances by passing in a value that will always be less than
// the
// difference between the current time and the close time of a connection.
- closeUnusedSpanners(Long.MIN_VALUE);
+ closeUnusedSpanners(Long.MIN_VALUE, closeSpannerFunction);
} else {
logLeakedConnections(keysStillInUse);
throw SpannerExceptionFactory.newSpannerException(
@@ -456,6 +472,11 @@ private void logLeakedConnections(List keysStillInUse) {
*/
@VisibleForTesting
void closeUnusedSpanners(long closeSpannerAfterMillisecondsUnused) {
+ closeUnusedSpanners(closeSpannerAfterMillisecondsUnused, DEFAULT_CLOSE_FUNCTION);
+ }
+
+ void closeUnusedSpanners(
+ long closeSpannerAfterMillisecondsUnused, Function closeSpannerFunction) {
List keysToBeRemoved = new ArrayList<>();
synchronized (this) {
for (Entry entry : lastConnectionClosedAt.entrySet()) {
@@ -469,7 +490,9 @@ void closeUnusedSpanners(long closeSpannerAfterMillisecondsUnused) {
Spanner spanner = spanners.get(entry.getKey());
if (spanner != null) {
try {
- spanner.close();
+ closeSpannerFunction.apply(spanner);
+ } catch (Throwable t) {
+ // Ignore any errors and continue with the next one in the pool.
} finally {
// Even if the close operation failed, we should remove the spanner object as it is no
// longer valid.
@@ -484,11 +507,4 @@ void closeUnusedSpanners(long closeSpannerAfterMillisecondsUnused) {
}
}
}
-
- @VisibleForTesting
- int getCurrentSpannerCount() {
- synchronized (this) {
- return spanners.size();
- }
- }
}
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java
index baaadbe1676..131533a3374 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java
@@ -164,6 +164,14 @@ private static ListeningExecutorService createExecutorService() {
this.interceptors = Collections.unmodifiableList(interceptors);
}
+ void shutdown() {
+ executor.shutdown();
+ }
+
+ void awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
+ executor.awaitTermination(timeout, unit);
+ }
+
/**
* Shutdown this executor now and do not wait for any statement that is being executed to finish.
*/
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ForceCloseSpannerFunction.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ForceCloseSpannerFunction.java
new file mode 100644
index 00000000000..a065a20bb52
--- /dev/null
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ForceCloseSpannerFunction.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.spanner;
+
+import com.google.common.base.Function;
+import java.util.concurrent.TimeUnit;
+
+/** Class for tests that need to be able to force-close a {@link Spanner} instance. */
+public class ForceCloseSpannerFunction implements Function {
+ private final long timeout;
+ private final TimeUnit unit;
+
+ public ForceCloseSpannerFunction(long timeout, TimeUnit unit) {
+ this.timeout = timeout;
+ this.unit = unit;
+ }
+
+ public Void apply(Spanner spanner) {
+ if (spanner instanceof SpannerImpl) {
+ ((SpannerImpl) spanner).close(timeout, unit);
+ } else {
+ spanner.close();
+ }
+ return null;
+ }
+}
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java
index b2ebd826615..112621f8533 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java
@@ -16,13 +16,16 @@
package com.google.cloud.spanner.connection;
+import com.google.cloud.spanner.ForceCloseSpannerFunction;
import com.google.cloud.spanner.MockSpannerServiceImpl;
import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
+import com.google.cloud.spanner.RandomResultSetGenerator;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.admin.database.v1.MockDatabaseAdminImpl;
import com.google.cloud.spanner.admin.instance.v1.MockInstanceAdminImpl;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest.AbortInterceptor;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest.ITConnection;
+import com.google.cloud.spanner.connection.SpannerPool.CheckAndCloseSpannersMode;
import com.google.common.util.concurrent.AbstractFuture;
import com.google.longrunning.GetOperationRequest;
import com.google.longrunning.Operation;
@@ -49,6 +52,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
@@ -113,6 +117,7 @@ public abstract class AbstractMockServerTest {
private boolean futureParentHandlers;
private boolean exceptionRunnableParentHandlers;
private boolean nettyServerParentHandlers;
+ private boolean clientStreamParentHandlers;
@BeforeClass
public static void startStaticServer() throws IOException {
@@ -152,9 +157,7 @@ public void getOperation(
@AfterClass
public static void stopServer() throws Exception {
- SpannerPool.closeSpannerPool();
server.shutdown();
- server.awaitTermination();
}
@Before
@@ -169,22 +172,30 @@ public void setupResults() {
nettyServerParentHandlers =
Logger.getLogger("io.grpc.netty.shaded.io.grpc.netty.NettyServerHandler")
.getUseParentHandlers();
+ clientStreamParentHandlers =
+ Logger.getLogger("io.grpc.netty.shaded.io.grpc.netty.NettyServerHandler")
+ .getUseParentHandlers();
Logger.getLogger(AbstractFuture.class.getName()).setUseParentHandlers(false);
Logger.getLogger(LogExceptionRunnable.class.getName()).setUseParentHandlers(false);
Logger.getLogger("io.grpc.netty.shaded.io.grpc.netty.NettyServerHandler")
.setUseParentHandlers(false);
+ Logger.getLogger("io.grpc.internal.AbstractClientStream").setUseParentHandlers(false);
}
@After
public void closeSpannerPool() {
try {
- SpannerPool.closeSpannerPool();
+ SpannerPool.INSTANCE.checkAndCloseSpanners(
+ CheckAndCloseSpannersMode.ERROR,
+ new ForceCloseSpannerFunction(100L, TimeUnit.MILLISECONDS));
} finally {
Logger.getLogger(AbstractFuture.class.getName()).setUseParentHandlers(futureParentHandlers);
Logger.getLogger(LogExceptionRunnable.class.getName())
.setUseParentHandlers(exceptionRunnableParentHandlers);
Logger.getLogger("io.grpc.netty.shaded.io.grpc.netty.NettyServerHandler")
.setUseParentHandlers(nettyServerParentHandlers);
+ Logger.getLogger("io.grpc.internal.AbstractClientStream")
+ .setUseParentHandlers(clientStreamParentHandlers);
}
}
diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
index 9174ef81b22..4e1238077e2 100644
--- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
+++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SpannerPoolTest.java
@@ -17,12 +17,15 @@
package com.google.cloud.spanner.connection;
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import com.google.auth.Credentials;
import com.google.cloud.NoCredentials;
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.SessionPoolOptions;
@@ -430,8 +433,9 @@ public void testSpannerPoolKeyEquality() {
ConnectionOptions options1 =
ConnectionOptions.newBuilder()
.setUri(
- "cloudspanner:/projects/p/instances/i/databases/d?minSessions=200;maxSessions=400")
- .setCredentials(NoCredentials.getInstance())
+ "cloudspanner://localhost:9010/projects/p1/instances/i/databases/d"
+ + "?minSessions=200;maxSessions=400;numChannels=8;usePlainText=true;userAgent=test-agent")
+ .setCredentials(mock(Credentials.class))
.build();
// options2 equals the default session pool options, and is therefore equal to ConnectionOptions
// without any session pool configuration.
@@ -451,8 +455,9 @@ public void testSpannerPoolKeyEquality() {
SpannerPoolKey key2 = SpannerPoolKey.of(options2);
SpannerPoolKey key3 = SpannerPoolKey.of(options3);
- assertThat(key1).isNotEqualTo(key2);
- assertThat(key2).isEqualTo(key3);
- assertThat(key1).isNotEqualTo(key3);
+ assertFalse(key1.equals(key2));
+ assertTrue(key2.equals(key3));
+ assertFalse(key1.equals(key3));
+ assertFalse(key1.equals(new Object()));
}
}
From 7cdfb82b40487600547d0bad92119508161ca689 Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
Date: Mon, 8 Feb 2021 17:22:10 -0800
Subject: [PATCH 30/42] feat: generate sample code in the Java microgenerator
(#859)
Committer: @miraleung
PiperOrigin-RevId: 356341083
Source-Author: Google APIs
Source-Date: Mon Feb 8 13:33:28 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 8d8c008e56f1af31d57f75561e0f1848ffb29eeb
Source-Link: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb
---
.../database/v1/DatabaseAdminClient.java | 970 ++++++++++++++++++
.../admin/database/v1/package-info.java | 7 +
.../instance/v1/InstanceAdminClient.java | 541 ++++++++++
.../admin/instance/v1/package-info.java | 7 +
.../cloud/spanner/v1/SpannerClient.java | 675 ++++++++++++
.../google/cloud/spanner/v1/package-info.java | 7 +
synth.metadata | 6 +-
7 files changed, 2210 insertions(+), 3 deletions(-)
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
index cab26e07702..9e829e30d4e 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
@@ -85,6 +85,13 @@
*
This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
+ *
Note: close() needs to be called on the DatabaseAdminClient object to clean up resources such
* as threads. In the example above, try-with-resources is used, which automatically calls close().
*
@@ -199,6 +206,17 @@ public final OperationsClient getOperationsClient() {
/**
* Lists Cloud Spanner databases.
*
+ *
+ *
* @param parent Required. The instance whose databases should be listed. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -215,6 +233,17 @@ public final ListDatabasesPagedResponse listDatabases(InstanceName parent) {
/**
* Lists Cloud Spanner databases.
*
+ *
+ *
* @param parent Required. The instance whose databases should be listed. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -228,6 +257,22 @@ public final ListDatabasesPagedResponse listDatabases(String parent) {
/**
* Lists Cloud Spanner databases.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -240,6 +285,23 @@ public final ListDatabasesPagedResponse listDatabases(ListDatabasesRequest reque
* Lists Cloud Spanner databases.
*
*
*/
public final UnaryCallable listDatabasesCallable() {
return stub.listDatabasesCallable();
@@ -266,6 +345,16 @@ public final UnaryCallable listData
* [response][google.longrunning.Operation.response] field type is
* [Database][google.spanner.admin.database.v1.Database], if successful.
*
+ *
+ *
* @param parent Required. The name of the instance that will serve the new database. Values are
* of the form `projects/<project>/instances/<instance>`.
* @param createStatement Required. A `CREATE DATABASE` statement, which specifies the ID of the
@@ -295,6 +384,16 @@ public final OperationFuture createDatabaseAsy
* [response][google.longrunning.Operation.response] field type is
* [Database][google.spanner.admin.database.v1.Database], if successful.
*
+ *
+ *
* @param parent Required. The name of the instance that will serve the new database. Values are
* of the form `projects/<project>/instances/<instance>`.
* @param createStatement Required. A `CREATE DATABASE` statement, which specifies the ID of the
@@ -324,6 +423,20 @@ public final OperationFuture createDatabaseAsy
* [response][google.longrunning.Operation.response] field type is
* [Database][google.spanner.admin.database.v1.Database], if successful.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -343,6 +456,21 @@ public final OperationFuture createDatabaseAsy
* [Database][google.spanner.admin.database.v1.Database], if successful.
*
*
*/
public final OperationCallable
createDatabaseOperationCallable() {
@@ -360,6 +488,21 @@ public final OperationFuture createDatabaseAsy
* [Database][google.spanner.admin.database.v1.Database], if successful.
*
*
*/
public final UnaryCallable createDatabaseCallable() {
return stub.createDatabaseCallable();
@@ -369,6 +512,15 @@ public final UnaryCallable createDatabaseCalla
/**
* Gets the state of a Cloud Spanner database.
*
+ *
+ *
* @param name Required. The name of the requested database. Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -383,6 +535,15 @@ public final Database getDatabase(DatabaseName name) {
/**
* Gets the state of a Cloud Spanner database.
*
+ *
+ *
* @param name Required. The name of the requested database. Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -396,6 +557,18 @@ public final Database getDatabase(String name) {
/**
* Gets the state of a Cloud Spanner database.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -408,6 +581,18 @@ public final Database getDatabase(GetDatabaseRequest request) {
* Gets the state of a Cloud Spanner database.
*
*
*/
public final UnaryCallable getDatabaseCallable() {
return stub.getDatabaseCallable();
@@ -423,6 +608,16 @@ public final UnaryCallable getDatabaseCallable() {
* [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The
* operation has no response.
*
+ *
+ *
* @param database Required. The database to update.
* @param statements Required. DDL statements to be applied to the database.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -447,6 +642,16 @@ public final OperationFuture updateDatabaseDdl
* [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The
* operation has no response.
*
+ *
+ *
* @param database Required. The database to update.
* @param statements Required. DDL statements to be applied to the database.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -471,6 +676,20 @@ public final OperationFuture updateDatabaseDdl
* [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The
* operation has no response.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -490,6 +709,21 @@ public final OperationFuture updateDatabaseDdl
* operation has no response.
*
*
*/
public final OperationCallable
updateDatabaseDdlOperationCallable() {
@@ -507,6 +741,21 @@ public final OperationFuture updateDatabaseDdl
* operation has no response.
*
*
*/
public final UnaryCallable updateDatabaseDdlCallable() {
return stub.updateDatabaseDdlCallable();
@@ -517,6 +766,15 @@ public final UnaryCallable updateDatabaseDd
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
* retained according to their `expire_time`.
*
+ *
+ *
* @param database Required. The database to be dropped.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -533,6 +791,15 @@ public final void dropDatabase(DatabaseName database) {
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
* retained according to their `expire_time`.
*
+ *
+ *
* @param database Required. The database to be dropped.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -546,6 +813,18 @@ public final void dropDatabase(String database) {
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
* retained according to their `expire_time`.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -559,6 +838,18 @@ public final void dropDatabase(DropDatabaseRequest request) {
* retained according to their `expire_time`.
*
*
*/
public final UnaryCallable dropDatabaseCallable() {
return stub.dropDatabaseCallable();
@@ -570,6 +861,15 @@ public final UnaryCallable dropDatabaseCallable() {
* method does not show pending schema updates, those may be queried using the
* [Operations][google.longrunning.Operations] API.
*
+ *
+ *
* @param database Required. The database whose schema we wish to get. Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -588,6 +888,15 @@ public final GetDatabaseDdlResponse getDatabaseDdl(DatabaseName database) {
* method does not show pending schema updates, those may be queried using the
* [Operations][google.longrunning.Operations] API.
*
+ *
+ *
* @param database Required. The database whose schema we wish to get. Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -604,6 +913,18 @@ public final GetDatabaseDdlResponse getDatabaseDdl(String database) {
* method does not show pending schema updates, those may be queried using the
* [Operations][google.longrunning.Operations] API.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -618,6 +939,19 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request
* [Operations][google.longrunning.Operations] API.
*
*
*/
public final UnaryCallable
getDatabaseDdlCallable() {
@@ -633,6 +967,16 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request
* `spanner.backups.setIamPolicy` permission on
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being specified. See the
* operation documentation for the appropriate value for this field.
* @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
@@ -658,6 +1002,16 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
* `spanner.backups.setIamPolicy` permission on
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being specified. See the
* operation documentation for the appropriate value for this field.
* @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
@@ -680,6 +1034,19 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* `spanner.backups.setIamPolicy` permission on
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -697,6 +1064,19 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
*
+ *
* @param resource REQUIRED: The resource for which the policy is being requested. See the
* operation documentation for the appropriate value for this field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -734,6 +1123,15 @@ public final Policy getIamPolicy(ResourceName resource) {
* `spanner.backups.getIamPolicy` permission on
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being requested. See the
* operation documentation for the appropriate value for this field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -753,6 +1151,19 @@ public final Policy getIamPolicy(String resource) {
* `spanner.backups.getIamPolicy` permission on
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -771,6 +1182,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
*
*/
public final UnaryCallable getIamPolicyCallable() {
return stub.getIamPolicyCallable();
@@ -786,6 +1210,17 @@ public final UnaryCallable getIamPolicyCallable() {
* does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
* permission on the containing instance.
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy detail is being requested. See the
* operation documentation for the appropriate value for this field.
* @param permissions The set of permissions to check for the `resource`. Permissions with
@@ -813,6 +1248,17 @@ public final TestIamPermissionsResponse testIamPermissions(
* does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
* permission on the containing instance.
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy detail is being requested. See the
* operation documentation for the appropriate value for this field.
* @param permissions The set of permissions to check for the `resource`. Permissions with
@@ -840,6 +1286,19 @@ public final TestIamPermissionsResponse testIamPermissions(
* does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list`
* permission on the containing instance.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -858,6 +1317,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* permission on the containing instance.
*
*
*/
public final UnaryCallable
testIamPermissionsCallable() {
@@ -877,6 +1350,17 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* operation will stop the creation and delete the backup. There can be only one pending backup
* creation per database. Backup creation of different databases can run concurrently.
*
+ *
+ *
* @param parent Required. The name of the instance in which the backup will be created. This must
* be the same instance that contains the database the backup will be created from. The backup
* will be stored in the location(s) specified in the instance configuration of this instance.
@@ -911,6 +1395,17 @@ public final OperationFuture createBackupAsync(
* operation will stop the creation and delete the backup. There can be only one pending backup
* creation per database. Backup creation of different databases can run concurrently.
*
+ *
+ *
* @param parent Required. The name of the instance in which the backup will be created. This must
* be the same instance that contains the database the backup will be created from. The backup
* will be stored in the location(s) specified in the instance configuration of this instance.
@@ -945,6 +1440,20 @@ public final OperationFuture createBackupAsync(
* operation will stop the creation and delete the backup. There can be only one pending backup
* creation per database. Backup creation of different databases can run concurrently.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -967,6 +1476,21 @@ public final OperationFuture createBackupAsync(
* creation per database. Backup creation of different databases can run concurrently.
*
*
*/
public final OperationCallable
createBackupOperationCallable() {
@@ -987,6 +1511,20 @@ public final OperationFuture createBackupAsync(
* creation per database. Backup creation of different databases can run concurrently.
*
*
*/
public final UnaryCallable createBackupCallable() {
return stub.createBackupCallable();
@@ -996,6 +1534,15 @@ public final UnaryCallable createBackupCallable(
/**
* Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param name Required. Name of the backup. Values are of the form
* `projects/<project>/instances/<instance>/backups/<backup>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1010,6 +1557,15 @@ public final Backup getBackup(BackupName name) {
/**
* Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param name Required. Name of the backup. Values are of the form
* `projects/<project>/instances/<instance>/backups/<backup>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1023,6 +1579,18 @@ public final Backup getBackup(String name) {
/**
* Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1035,6 +1603,18 @@ public final Backup getBackup(GetBackupRequest request) {
* Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
*
*/
public final UnaryCallable getBackupCallable() {
return stub.getBackupCallable();
@@ -1044,6 +1624,16 @@ public final UnaryCallable getBackupCallable() {
/**
* Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param backup Required. The backup to update. `backup.name`, and the fields to be updated as
* specified by `update_mask` are required. Other fields are ignored. Update is only supported
* for the following fields: * `backup.expire_time`.
@@ -1063,6 +1653,19 @@ public final Backup updateBackup(Backup backup, FieldMask updateMask) {
/**
* Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1075,6 +1678,19 @@ public final Backup updateBackup(UpdateBackupRequest request) {
* Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
*
*/
public final UnaryCallable updateBackupCallable() {
return stub.updateBackupCallable();
@@ -1084,6 +1700,15 @@ public final UnaryCallable updateBackupCallable() {
/**
* Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param name Required. Name of the backup to delete. Values are of the form
* `projects/<project>/instances/<instance>/backups/<backup>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1098,6 +1723,15 @@ public final void deleteBackup(BackupName name) {
/**
* Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param name Required. Name of the backup to delete. Values are of the form
* `projects/<project>/instances/<instance>/backups/<backup>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1111,6 +1745,18 @@ public final void deleteBackup(String name) {
/**
* Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1123,6 +1769,18 @@ public final void deleteBackup(DeleteBackupRequest request) {
* Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
*
*
*/
public final UnaryCallable deleteBackupCallable() {
return stub.deleteBackupCallable();
@@ -1133,6 +1791,17 @@ public final UnaryCallable deleteBackupCallable() {
* Lists completed and pending backups. Backups returned are ordered by `create_time` in
* descending order, starting from the most recent `create_time`.
*
+ *
+ *
* @param parent Required. The instance to list backups from. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1150,6 +1819,17 @@ public final ListBackupsPagedResponse listBackups(InstanceName parent) {
* Lists completed and pending backups. Backups returned are ordered by `create_time` in
* descending order, starting from the most recent `create_time`.
*
+ *
+ *
* @param parent Required. The instance to list backups from. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1164,6 +1844,23 @@ public final ListBackupsPagedResponse listBackups(String parent) {
* Lists completed and pending backups. Backups returned are ordered by `create_time` in
* descending order, starting from the most recent `create_time`.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1177,6 +1874,23 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) {
* descending order, starting from the most recent `create_time`.
*
*
*/
public final UnaryCallable
listBackupsPagedCallable() {
@@ -1189,6 +1903,23 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) {
* descending order, starting from the most recent `create_time`.
*
*
*/
public final UnaryCallable listBackupsCallable() {
return stub.listBackupsCallable();
@@ -1211,6 +1942,18 @@ public final UnaryCallable listBackupsC
* operation can be initiated, without waiting for the optimize operation associated with the
* first restore to complete.
*
+ *
+ *
* @param parent Required. The name of the instance in which to create the restored database. This
* instance must be in the same project and have the same instance configuration as the
* instance containing the source backup. Values are of the form
@@ -1251,6 +1994,18 @@ public final OperationFuture restoreDatabaseA
* operation can be initiated, without waiting for the optimize operation associated with the
* first restore to complete.
*
+ *
+ *
* @param parent Required. The name of the instance in which to create the restored database. This
* instance must be in the same project and have the same instance configuration as the
* instance containing the source backup. Values are of the form
@@ -1291,6 +2046,18 @@ public final OperationFuture restoreDatabaseA
* operation can be initiated, without waiting for the optimize operation associated with the
* first restore to complete.
*
+ *
+ *
* @param parent Required. The name of the instance in which to create the restored database. This
* instance must be in the same project and have the same instance configuration as the
* instance containing the source backup. Values are of the form
@@ -1331,6 +2098,18 @@ public final OperationFuture restoreDatabaseA
* operation can be initiated, without waiting for the optimize operation associated with the
* first restore to complete.
*
+ *
+ *
* @param parent Required. The name of the instance in which to create the restored database. This
* instance must be in the same project and have the same instance configuration as the
* instance containing the source backup. Values are of the form
@@ -1371,6 +2150,19 @@ public final OperationFuture restoreDatabaseA
* operation can be initiated, without waiting for the optimize operation associated with the
* first restore to complete.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1397,6 +2189,20 @@ public final OperationFuture restoreDatabaseA
* first restore to complete.
*
*
*/
public final OperationCallable
restoreDatabaseOperationCallable() {
@@ -1421,6 +2227,20 @@ public final OperationFuture restoreDatabaseA
* first restore to complete.
*
*
*/
public final UnaryCallable restoreDatabaseCallable() {
return stub.restoreDatabaseCallable();
@@ -1435,6 +2255,17 @@ public final UnaryCallable restoreDatabaseCal
* `metadata.type_url` describes the type of the metadata. Operations returned include those that
* have completed/failed/canceled within the last 7 days, and pending operations.
*
+ *
+ *
* @param parent Required. The instance of the database operations. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1456,6 +2287,17 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(Instance
* `metadata.type_url` describes the type of the metadata. Operations returned include those that
* have completed/failed/canceled within the last 7 days, and pending operations.
*
+ *
+ *
* @param parent Required. The instance of the database operations. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1475,6 +2317,23 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(String p
* `metadata.type_url` describes the type of the metadata. Operations returned include those that
* have completed/failed/canceled within the last 7 days, and pending operations.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1493,6 +2352,24 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(
* have completed/failed/canceled within the last 7 days, and pending operations.
*
*
*/
public final UnaryCallable
listDatabaseOperationsPagedCallable() {
@@ -1509,6 +2386,24 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(
* have completed/failed/canceled within the last 7 days, and pending operations.
*
*
*/
public final UnaryCallable
listDatabaseOperationsCallable() {
@@ -1526,6 +2421,17 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(
* returned are ordered by `operation.metadata.value.progress.start_time` in descending order
* starting from the most recently started operation.
*
+ *
+ *
* @param parent Required. The instance of the backup operations. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1549,6 +2455,17 @@ public final ListBackupOperationsPagedResponse listBackupOperations(InstanceName
* returned are ordered by `operation.metadata.value.progress.start_time` in descending order
* starting from the most recently started operation.
*
+ *
+ *
* @param parent Required. The instance of the backup operations. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1570,6 +2487,23 @@ public final ListBackupOperationsPagedResponse listBackupOperations(String paren
* returned are ordered by `operation.metadata.value.progress.start_time` in descending order
* starting from the most recently started operation.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1590,6 +2524,24 @@ public final ListBackupOperationsPagedResponse listBackupOperations(
* starting from the most recently started operation.
*
*
*/
public final UnaryCallable
listBackupOperationsPagedCallable() {
@@ -1608,6 +2560,24 @@ public final ListBackupOperationsPagedResponse listBackupOperations(
* starting from the most recently started operation.
*
*
*/
public final UnaryCallable
listBackupOperationsCallable() {
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java
index a7a4a8722e0..6723f47e828 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java
@@ -26,6 +26,13 @@
* list backups for a database and to restore from an existing backup.
*
*
This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
+ *
Note: close() needs to be called on the InstanceAdminClient object to clean up resources such
* as threads. In the example above, try-with-resources is used, which automatically calls close().
*
@@ -199,6 +206,17 @@ public final OperationsClient getOperationsClient() {
/**
* Lists the supported instance configurations for a given project.
*
+ *
+ *
* @param parent Required. The name of the project for which a list of supported instance
* configurations is requested. Values are of the form `projects/<project>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -215,6 +233,17 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(ProjectName pa
/**
* Lists the supported instance configurations for a given project.
*
+ *
+ *
* @param parent Required. The name of the project for which a list of supported instance
* configurations is requested. Values are of the form `projects/<project>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -229,6 +258,22 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(String parent)
/**
* Lists the supported instance configurations for a given project.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -242,6 +287,23 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(
* Lists the supported instance configurations for a given project.
*
*
*/
public final UnaryCallable
listInstanceConfigsPagedCallable() {
@@ -253,6 +315,24 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(
* Lists the supported instance configurations for a given project.
*
*
*/
public final UnaryCallable
listInstanceConfigsCallable() {
@@ -263,6 +343,15 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(
/**
* Gets information about a particular instance configuration.
*
+ *
+ *
* @param name Required. The name of the requested instance configuration. Values are of the form
* `projects/<project>/instanceConfigs/<config>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -279,6 +368,15 @@ public final InstanceConfig getInstanceConfig(InstanceConfigName name) {
/**
* Gets information about a particular instance configuration.
*
+ *
+ *
* @param name Required. The name of the requested instance configuration. Values are of the form
* `projects/<project>/instanceConfigs/<config>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -292,6 +390,18 @@ public final InstanceConfig getInstanceConfig(String name) {
/**
* Gets information about a particular instance configuration.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -304,6 +414,19 @@ public final InstanceConfig getInstanceConfig(GetInstanceConfigRequest request)
* Gets information about a particular instance configuration.
*
*
*/
public final UnaryCallable getInstanceConfigCallable() {
return stub.getInstanceConfigCallable();
@@ -313,6 +436,17 @@ public final UnaryCallable getInstance
/**
* Lists all instances in the given project.
*
+ *
+ *
* @param parent Required. The name of the project for which a list of instances is requested.
* Values are of the form `projects/<project>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -329,6 +463,17 @@ public final ListInstancesPagedResponse listInstances(ProjectName parent) {
/**
* Lists all instances in the given project.
*
+ *
+ *
* @param parent Required. The name of the project for which a list of instances is requested.
* Values are of the form `projects/<project>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -342,6 +487,23 @@ public final ListInstancesPagedResponse listInstances(String parent) {
/**
* Lists all instances in the given project.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -354,6 +516,24 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* Lists all instances in the given project.
*
*
*/
public final UnaryCallable
listInstancesPagedCallable() {
@@ -365,6 +545,23 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* Lists all instances in the given project.
*
*
*/
public final UnaryCallable listInstancesCallable() {
return stub.listInstancesCallable();
@@ -374,6 +571,15 @@ public final UnaryCallable listInst
/**
* Gets information about a particular instance.
*
+ *
+ *
* @param name Required. The name of the requested instance. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -388,6 +594,15 @@ public final Instance getInstance(InstanceName name) {
/**
* Gets information about a particular instance.
*
+ *
+ *
* @param name Required. The name of the requested instance. Values are of the form
* `projects/<project>/instances/<instance>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -401,6 +616,19 @@ public final Instance getInstance(String name) {
/**
* Gets information about a particular instance.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -413,6 +641,19 @@ public final Instance getInstance(GetInstanceRequest request) {
* Gets information about a particular instance.
*
*
*/
public final UnaryCallable getInstanceCallable() {
return stub.getInstanceCallable();
@@ -450,6 +691,18 @@ public final UnaryCallable getInstanceCallable() {
* [response][google.longrunning.Operation.response] field type is
* [Instance][google.spanner.admin.instance.v1.Instance], if successful.
*
+ *
+ *
* @param parent Required. The name of the project in which to create the instance. Values are of
* the form `projects/<project>`.
* @param instanceId Required. The ID of the instance to create. Valid identifiers are of the form
@@ -501,6 +754,18 @@ public final OperationFuture createInstanceAsy
* [response][google.longrunning.Operation.response] field type is
* [Instance][google.spanner.admin.instance.v1.Instance], if successful.
*
+ *
+ *
* @param parent Required. The name of the project in which to create the instance. Values are of
* the form `projects/<project>`.
* @param instanceId Required. The ID of the instance to create. Valid identifiers are of the form
@@ -552,6 +817,20 @@ public final OperationFuture createInstanceAsy
* [response][google.longrunning.Operation.response] field type is
* [Instance][google.spanner.admin.instance.v1.Instance], if successful.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -593,6 +872,21 @@ public final OperationFuture createInstanceAsy
* [Instance][google.spanner.admin.instance.v1.Instance], if successful.
*
*
*/
public final OperationCallable
createInstanceOperationCallable() {
@@ -632,6 +926,21 @@ public final OperationFuture createInstanceAsy
* [Instance][google.spanner.admin.instance.v1.Instance], if successful.
*
*
*/
public final UnaryCallable createInstanceCallable() {
return stub.createInstanceCallable();
@@ -673,6 +982,16 @@ public final UnaryCallable createInstanceCalla
*
+ *
* @param instance Required. The instance to update, which must always include the instance name.
* Otherwise, only fields mentioned in
* [field_mask][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be
@@ -727,6 +1046,19 @@ public final OperationFuture updateInstanceAsy
*
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -772,6 +1104,20 @@ public final OperationFuture updateInstanceAsy
* [name][google.spanner.admin.instance.v1.Instance.name].
*
*
*/
public final OperationCallable
updateInstanceOperationCallable() {
@@ -815,6 +1161,20 @@ public final OperationFuture updateInstanceAsy
* [name][google.spanner.admin.instance.v1.Instance.name].
*
*
*/
public final UnaryCallable updateInstanceCallable() {
return stub.updateInstanceCallable();
@@ -833,6 +1193,15 @@ public final UnaryCallable updateInstanceCalla
*
* The instance and *all of its databases* immediately and irrevocably disappear
* from the API. All data in the databases is permanently deleted.
*
+ *
+ *
* @param name Required. The name of the instance to be deleted. Values are of the form
* `projects/<project>/instances/<instance>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -856,6 +1225,15 @@ public final void deleteInstance(InstanceName name) {
*
* The instance and *all of its databases* immediately and irrevocably disappear
* from the API. All data in the databases is permanently deleted.
*
+ *
+ *
* @param name Required. The name of the instance to be deleted. Values are of the form
* `projects/<project>/instances/<instance>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -878,6 +1256,18 @@ public final void deleteInstance(String name) {
*
* The instance and *all of its databases* immediately and irrevocably disappear
* from the API. All data in the databases is permanently deleted.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -899,6 +1289,18 @@ public final void deleteInstance(DeleteInstanceRequest request) {
* from the API. All data in the databases is permanently deleted.
*
*
*/
public final UnaryCallable deleteInstanceCallable() {
return stub.deleteInstanceCallable();
@@ -911,6 +1313,16 @@ public final UnaryCallable deleteInstanceCallable(
*
Authorization requires `spanner.instances.setIamPolicy` on
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being specified. See the
* operation documentation for the appropriate value for this field.
* @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
@@ -934,6 +1346,16 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
*
Authorization requires `spanner.instances.setIamPolicy` on
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being specified. See the
* operation documentation for the appropriate value for this field.
* @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
@@ -954,6 +1376,19 @@ public final Policy setIamPolicy(String resource, Policy policy) {
*
Authorization requires `spanner.instances.setIamPolicy` on
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -969,6 +1404,19 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* [resource][google.iam.v1.SetIamPolicyRequest.resource].
*
*
*/
public final UnaryCallable setIamPolicyCallable() {
return stub.setIamPolicyCallable();
@@ -982,6 +1430,15 @@ public final UnaryCallable setIamPolicyCallable() {
*
Authorization requires `spanner.instances.getIamPolicy` on
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being requested. See the
* operation documentation for the appropriate value for this field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1002,6 +1459,15 @@ public final Policy getIamPolicy(ResourceName resource) {
*
Authorization requires `spanner.instances.getIamPolicy` on
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy is being requested. See the
* operation documentation for the appropriate value for this field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1019,6 +1485,19 @@ public final Policy getIamPolicy(String resource) {
*
Authorization requires `spanner.instances.getIamPolicy` on
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1035,6 +1514,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* [resource][google.iam.v1.GetIamPolicyRequest.resource].
*
*
*/
public final UnaryCallable getIamPolicyCallable() {
return stub.getIamPolicyCallable();
@@ -1048,6 +1540,17 @@ public final UnaryCallable getIamPolicyCallable() {
* NOT_FOUND error if the user has `spanner.instances.list` permission on the containing Google
* Cloud Project. Otherwise returns an empty set of permissions.
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy detail is being requested. See the
* operation documentation for the appropriate value for this field.
* @param permissions The set of permissions to check for the `resource`. Permissions with
@@ -1073,6 +1576,17 @@ public final TestIamPermissionsResponse testIamPermissions(
* NOT_FOUND error if the user has `spanner.instances.list` permission on the containing Google
* Cloud Project. Otherwise returns an empty set of permissions.
*
+ *
+ *
* @param resource REQUIRED: The resource for which the policy detail is being requested. See the
* operation documentation for the appropriate value for this field.
* @param permissions The set of permissions to check for the `resource`. Permissions with
@@ -1098,6 +1612,19 @@ public final TestIamPermissionsResponse testIamPermissions(
* NOT_FOUND error if the user has `spanner.instances.list` permission on the containing Google
* Cloud Project. Otherwise returns an empty set of permissions.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1114,6 +1641,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* Cloud Project. Otherwise returns an empty set of permissions.
*
*
*/
public final UnaryCallable
testIamPermissionsCallable() {
diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java
index 189e53a2d60..19b1d13aca7 100644
--- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java
+++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java
@@ -38,6 +38,13 @@
* databases in that instance, and their performance may suffer.
*
*
This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
+ *
Note: close() needs to be called on the SpannerClient object to clean up resources such as
* threads. In the example above, try-with-resources is used, which automatically calls close().
*
@@ -187,6 +194,15 @@ public SpannerStub getStub() {
*
Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT
* 1"`.
*
+ *
+ *
* @param database Required. The database in which the new session is created.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -216,6 +232,15 @@ public final Session createSession(DatabaseName database) {
*
Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT
* 1"`.
*
+ *
+ *
* @param database Required. The database in which the new session is created.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -242,6 +267,19 @@ public final Session createSession(String database) {
*
Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT
* 1"`.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -268,6 +306,19 @@ public final Session createSession(CreateSessionRequest request) {
* 1"`.
*
*
*/
public final UnaryCallable createSessionCallable() {
return stub.createSessionCallable();
@@ -280,6 +331,17 @@ public final UnaryCallable createSessionCallable(
*
This API can be used to initialize a session cache on the clients. See https://goo.gl/TgSFN2
* for best practices on session cache management.
*
+ *
+ *
* @param database Required. The database in which the new sessions are created.
* @param sessionCount Required. The number of sessions to be created in this batch call. The API
* may return fewer than the requested number of sessions. If a specific number of sessions
@@ -304,6 +366,17 @@ public final BatchCreateSessionsResponse batchCreateSessions(
*
This API can be used to initialize a session cache on the clients. See https://goo.gl/TgSFN2
* for best practices on session cache management.
*
+ *
+ *
* @param database Required. The database in which the new sessions are created.
* @param sessionCount Required. The number of sessions to be created in this batch call. The API
* may return fewer than the requested number of sessions. If a specific number of sessions
@@ -327,6 +400,20 @@ public final BatchCreateSessionsResponse batchCreateSessions(String database, in
*
This API can be used to initialize a session cache on the clients. See https://goo.gl/TgSFN2
* for best practices on session cache management.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -342,6 +429,21 @@ public final BatchCreateSessionsResponse batchCreateSessions(BatchCreateSessions
* for best practices on session cache management.
*
*
*/
public final UnaryCallable
batchCreateSessionsCallable() {
@@ -353,6 +455,15 @@ public final BatchCreateSessionsResponse batchCreateSessions(BatchCreateSessions
* Gets a session. Returns `NOT_FOUND` if the session does not exist. This is mainly useful for
* determining whether a session is still alive.
*
+ *
+ *
* @param name Required. The name of the session to retrieve.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -367,6 +478,15 @@ public final Session getSession(SessionName name) {
* Gets a session. Returns `NOT_FOUND` if the session does not exist. This is mainly useful for
* determining whether a session is still alive.
*
+ *
+ *
* @param name Required. The name of the session to retrieve.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -380,6 +500,19 @@ public final Session getSession(String name) {
* Gets a session. Returns `NOT_FOUND` if the session does not exist. This is mainly useful for
* determining whether a session is still alive.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -393,6 +526,19 @@ public final Session getSession(GetSessionRequest request) {
* determining whether a session is still alive.
*
*
*/
public final UnaryCallable getSessionCallable() {
return stub.getSessionCallable();
@@ -402,6 +548,17 @@ public final UnaryCallable getSessionCallable() {
/**
* Lists all sessions in a given database.
*
+ *
+ *
* @param database Required. The database in which to list sessions.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -417,6 +574,17 @@ public final ListSessionsPagedResponse listSessions(DatabaseName database) {
/**
* Lists all sessions in a given database.
*
+ *
+ *
* @param database Required. The database in which to list sessions.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -429,6 +597,23 @@ public final ListSessionsPagedResponse listSessions(String database) {
/**
* Lists all sessions in a given database.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -441,6 +626,23 @@ public final ListSessionsPagedResponse listSessions(ListSessionsRequest request)
* Lists all sessions in a given database.
*
*
*/
public final UnaryCallable
listSessionsPagedCallable() {
@@ -452,6 +654,23 @@ public final ListSessionsPagedResponse listSessions(ListSessionsRequest request)
* Lists all sessions in a given database.
*
*
*/
public final UnaryCallable listSessionsCallable() {
return stub.listSessionsCallable();
@@ -462,6 +681,15 @@ public final UnaryCallable listSessio
* Ends a session, releasing server resources associated with it. This will asynchronously trigger
* cancellation of any operations that are running with this session.
*
+ *
+ *
* @param name Required. The name of the session to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -476,6 +704,15 @@ public final void deleteSession(SessionName name) {
* Ends a session, releasing server resources associated with it. This will asynchronously trigger
* cancellation of any operations that are running with this session.
*
+ *
+ *
* @param name Required. The name of the session to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -489,6 +726,19 @@ public final void deleteSession(String name) {
* Ends a session, releasing server resources associated with it. This will asynchronously trigger
* cancellation of any operations that are running with this session.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -502,6 +752,19 @@ public final void deleteSession(DeleteSessionRequest request) {
* cancellation of any operations that are running with this session.
*
*
*/
public final UnaryCallable deleteSessionCallable() {
return stub.deleteSessionCallable();
@@ -520,6 +783,27 @@ public final UnaryCallable deleteSessionCallable()
*
Larger result sets can be fetched in streaming fashion by calling
* [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -541,6 +825,27 @@ public final ResultSet executeSql(ExecuteSqlRequest request) {
* [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead.
*
*
*/
public final UnaryCallable executeSqlCallable() {
return stub.executeSqlCallable();
@@ -554,6 +859,29 @@ public final UnaryCallable executeSqlCallable() {
* MiB, and no column value can exceed 10 MiB.
*
*
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -594,6 +938,23 @@ public final ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest requ
*
Execution stops after the first failed statement; the remaining statements are not executed.
*
*
*/
public final UnaryCallable
executeBatchDmlCallable() {
@@ -614,6 +975,27 @@ public final ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest requ
*
Larger result sets can be yielded in streaming fashion by calling
* [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -636,6 +1018,27 @@ public final ResultSet read(ReadRequest request) {
* [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
*
*
*/
public final ServerStreamingCallable streamingReadCallable() {
return stub.streamingReadCallable();
@@ -660,6 +1085,16 @@ public final ServerStreamingCallable streamingRea
* [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
* [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a side-effect.
*
+ *
+ *
* @param session Required. The session in which the transaction runs.
* @param options Required. Options for the new transaction.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -679,6 +1114,17 @@ public final Transaction beginTransaction(SessionName session, TransactionOption
* [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
* [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a side-effect.
*
+ *
+ *
* @param session Required. The session in which the transaction runs.
* @param options Required. Options for the new transaction.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -695,6 +1141,20 @@ public final Transaction beginTransaction(String session, TransactionOptions opt
* [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
* [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a side-effect.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -709,6 +1169,20 @@ public final Transaction beginTransaction(BeginTransactionRequest request) {
* [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a side-effect.
*
*
*/
public final UnaryCallable beginTransactionCallable() {
return stub.beginTransactionCallable();
@@ -729,6 +1203,17 @@ public final UnaryCallable beginTransactio
* track of the transaction outcome and we recommend that you perform another read from the
* database to see the state of things as they are now.
*
+ *
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param transactionId Commit a previously-started transaction.
* @param mutations The mutations to be executed when this transaction commits. All mutations are
@@ -761,6 +1246,17 @@ public final CommitResponse commit(
* track of the transaction outcome and we recommend that you perform another read from the
* database to see the state of things as they are now.
*
+ *
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param singleUseTransaction Execute mutations in a temporary transaction. Note that unlike
* commit of a previously-started transaction, commit with a temporary transaction is
@@ -799,6 +1295,18 @@ public final CommitResponse commit(
* track of the transaction outcome and we recommend that you perform another read from the
* database to see the state of things as they are now.
*
+ *
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param transactionId Commit a previously-started transaction.
* @param mutations The mutations to be executed when this transaction commits. All mutations are
@@ -831,6 +1339,18 @@ public final CommitResponse commit(
* track of the transaction outcome and we recommend that you perform another read from the
* database to see the state of things as they are now.
*
+ *
+ *
* @param session Required. The session in which the transaction to be committed is running.
* @param singleUseTransaction Execute mutations in a temporary transaction. Note that unlike
* commit of a previously-started transaction, commit with a temporary transaction is
@@ -869,6 +1389,21 @@ public final CommitResponse commit(
* track of the transaction outcome and we recommend that you perform another read from the
* database to see the state of things as they are now.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -892,6 +1427,21 @@ public final CommitResponse commit(CommitRequest request) {
* database to see the state of things as they are now.
*
*
*/
public final UnaryCallable commitCallable() {
return stub.commitCallable();
@@ -907,6 +1457,16 @@ public final UnaryCallable commitCallable() {
*
`Rollback` returns `OK` if it successfully aborts the transaction, the transaction was
* already aborted, or the transaction is not found. `Rollback` never returns `ABORTED`.
*
+ *
+ *
* @param session Required. The session in which the transaction to roll back is running.
* @param transactionId Required. The transaction to roll back.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -930,6 +1490,17 @@ public final void rollback(SessionName session, ByteString transactionId) {
*
`Rollback` returns `OK` if it successfully aborts the transaction, the transaction was
* already aborted, or the transaction is not found. `Rollback` never returns `ABORTED`.
*
+ *
+ *
* @param session Required. The session in which the transaction to roll back is running.
* @param transactionId Required. The transaction to roll back.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -950,6 +1521,20 @@ public final void rollback(String session, ByteString transactionId) {
*
`Rollback` returns `OK` if it successfully aborts the transaction, the transaction was
* already aborted, or the transaction is not found. `Rollback` never returns `ABORTED`.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -968,6 +1553,20 @@ public final void rollback(RollbackRequest request) {
* already aborted, or the transaction is not found. `Rollback` never returns `ABORTED`.
*
*
*/
public final UnaryCallable rollbackCallable() {
return stub.rollbackCallable();
@@ -986,6 +1585,24 @@ public final UnaryCallable rollbackCallable() {
* too long, begins a new transaction, or becomes too old. When any of these happen, it is not
* possible to resume the query, and the whole operation must be restarted from the beginning.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1007,6 +1624,25 @@ public final PartitionResponse partitionQuery(PartitionQueryRequest request) {
* possible to resume the query, and the whole operation must be restarted from the beginning.
*
*
*/
public final UnaryCallable partitionQueryCallable() {
return stub.partitionQueryCallable();
@@ -1026,6 +1662,25 @@ public final UnaryCallable partitionQu
* too long, begins a new transaction, or becomes too old. When any of these happen, it is not
* possible to resume the read, and the whole operation must be restarted from the beginning.
*
+ *
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -1048,6 +1703,26 @@ public final PartitionResponse partitionRead(PartitionReadRequest request) {
* possible to resume the read, and the whole operation must be restarted from the beginning.
*
*