Skip to content

Commit 37d2089

Browse files
authored
Merge branch 'main' into gfe_latency
2 parents d336d39 + f4560e5 commit 37d2089

20 files changed

+611
-24
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

77
# The @googleapis/api-spanner-java is the default owner for changes in this repo
8-
* @googleapis/yoshi-java @googleapis/api-spanner-java
9-
**/*.java @googleapis/api-spanner-java
10-
11-
# The java-samples-reviewers team is the default owner for samples changes
12-
samples/**/*.java @googleapis/java-samples-reviewers @googleapis/api-spanner-java
8+
* @googleapis/yoshi-java @googleapis/spanner-client-libraries-java

.kokoro/continuous/integration-cloud-devel-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ env_vars: {
2727
}
2828

2929
env_vars: {
30-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
30+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
3131
value: "true"
3232
}

.kokoro/continuous/integration-cloud-staging-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ env_vars: {
2727
}
2828

2929
env_vars: {
30-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
30+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
3131
value: "true"
3232
}

.kokoro/nightly/integration-cloud-devel-directpath-enabled.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ env_vars: {
2222
}
2323

2424
env_vars: {
25-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
25+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
2626
value: "true"
2727
}
28-

.kokoro/nightly/integration-cloud-staging-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ env_vars: {
2222
}
2323

2424
env_vars: {
25-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
25+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
2626
value: "true"
2727
}

.kokoro/nightly/integration-directpath-enabled.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ env_vars: {
3737
}
3838

3939
env_vars: {
40-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
40+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
4141
value: "true"
4242
}

.kokoro/presubmit/integration-directpath-enabled.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ env_vars: {
3333
}
3434

3535
env_vars: {
36-
key: "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
36+
key: "GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS"
3737
value: "true"
38-
}
38+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/
517517
| Create Instance Config Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstanceConfigSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstanceConfigSample.java) |
518518
| Create Instance Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstanceExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstanceExample.java) |
519519
| Create Instance Partition Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstancePartitionSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstancePartitionSample.java) |
520+
| Create Instance With Asymmetric Autoscaling Config Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithAsymmetricAutoscalingConfigExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithAsymmetricAutoscalingConfigExample.java) |
520521
| Create Instance With Autoscaling Config Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithAutoscalingConfigExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithAutoscalingConfigExample.java) |
521522
| Create Instance With Processing Units Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithProcessingUnitsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithProcessingUnitsExample.java) |
522523
| Create Instance Without Default Backup Schedules Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithoutDefaultBackupSchedulesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateInstanceWithoutDefaultBackupSchedulesExample.java) |

google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractMultiplexedSessionDatabaseClient.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616

1717
package com.google.cloud.spanner;
1818

19-
import com.google.api.gax.rpc.ServerStream;
2019
import com.google.cloud.Timestamp;
21-
import com.google.cloud.spanner.Options.TransactionOption;
22-
import com.google.spanner.v1.BatchWriteResponse;
2320

2421
/**
2522
* Base class for the Multiplexed Session {@link DatabaseClient} implementation. Throws {@link
@@ -43,11 +40,4 @@ public String getDatabaseRole() {
4340
public Timestamp writeAtLeastOnce(Iterable<Mutation> mutations) throws SpannerException {
4441
return writeAtLeastOnceWithOptions(mutations).getCommitTimestamp();
4542
}
46-
47-
@Override
48-
public ServerStream<BatchWriteResponse> batchWriteAtLeastOnce(
49-
Iterable<MutationGroup> mutationGroups, TransactionOption... options)
50-
throws SpannerException {
51-
throw new UnsupportedOperationException();
52-
}
5343
}

google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ public ServerStream<BatchWriteResponse> batchWriteAtLeastOnce(
189189
throws SpannerException {
190190
ISpan span = tracer.spanBuilder(READ_WRITE_TRANSACTION, commonAttributes, options);
191191
try (IScope s = tracer.withSpan(span)) {
192+
if (canUseMultiplexedSessionsForRW() && getMultiplexedSessionDatabaseClient() != null) {
193+
return getMultiplexedSessionDatabaseClient().batchWriteAtLeastOnce(mutationGroups, options);
194+
}
192195
return runWithSessionRetry(session -> session.batchWriteAtLeastOnce(mutationGroups, options));
193196
} catch (RuntimeException e) {
194197
span.setStatus(e);

0 commit comments

Comments
 (0)