Skip to content

Commit

Permalink
feat(spanner): Removed env variable for Partitioned Ops ensuring that…
Browse files Browse the repository at this point in the history
… Multiplexed Session for Partitioned Ops is not available to customers.
  • Loading branch information
pratickchokhani committed Dec 9, 2024
1 parent 2db1cc6 commit 263901f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ public static SessionPoolOptions.Builder setUseMultiplexedSessionForRW(
SessionPoolOptions.Builder sessionPoolOptionsBuilder, boolean useMultiplexedSessionForRW) {
return sessionPoolOptionsBuilder.setUseMultiplexedSessionForRW(useMultiplexedSessionForRW);
}

// TODO: Remove when multiplexed session for partitioned operations are released.
public static SessionPoolOptions.Builder setUseMultiplexedSessionForPartitionedOperations(
SessionPoolOptions.Builder sessionPoolOptionsBuilder,
boolean useMultiplexedSessionForPartitionedOps) {
return sessionPoolOptionsBuilder.setUseMultiplexedSessionPartitionedOps(
useMultiplexedSessionForPartitionedOps);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ private static Boolean getUseMultiplexedSessionFromEnvVariable() {
@VisibleForTesting
@InternalApi
protected static Boolean getUseMultiplexedSessionFromEnvVariablePartitionedOps() {
return parseBooleanEnvVariable("GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS");
// Checks the value of env, GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS
// This returns null until Partitioned Operations is supported.
return null;
}

private static Boolean parseBooleanEnvVariable(String variableName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import com.google.spanner.v1.Session;
import com.google.spanner.v1.Transaction;
import io.opentelemetry.api.OpenTelemetry;

import java.time.Duration;
import java.util.Collections;
import java.util.Map;
Expand Down

0 comments on commit 263901f

Please sign in to comment.