Skip to content

Commit d56908b

Browse files
committed
chore(spanner): add environment variable for enabling read-write multiplexed sessions
1 parent 3f4873d commit d56908b

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
JOB_TYPE: test
5555
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
5656
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true
57+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW: true
5758
units-java8:
5859
# Building using Java 17 and run the tests with Java 8 runtime
5960
name: "units (8)"
@@ -94,6 +95,7 @@ jobs:
9495
JOB_TYPE: test
9596
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
9697
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true
98+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW: true
9799
windows:
98100
runs-on: windows-latest
99101
steps:

.github/workflows/integration-tests-against-emulator-with-multiplexed-session.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ jobs:
4040
JOB_TYPE: test
4141
SPANNER_EMULATOR_HOST: localhost:9010
4242
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true
43+
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW: true

.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ env_vars: {
4141
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS"
4242
value: "true"
4343
}
44+
45+
env_vars: {
46+
key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW"
47+
value: "true"
48+
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,7 @@ private static Boolean parseBooleanEnvVariable(String variableName) {
391391
}
392392

393393
private static Boolean getUseMultiplexedSessionForRWFromEnvVariable() {
394-
// Checks the value of env, GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW
395-
// This returns null until RW is supported.
396-
return null;
394+
return parseBooleanEnvVariable("GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW");
397395
}
398396

399397
Duration getMultiplexedSessionMaintenanceDuration() {

0 commit comments

Comments
 (0)