Skip to content

Commit

Permalink
feat(spanner): Releasing Multiplexed session for blind write.
Browse files Browse the repository at this point in the history
  • Loading branch information
pratickchokhani committed Dec 10, 2024
1 parent 3f4873d commit fae2082
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,6 @@ private synchronized Spanner getClient(long timeoutSeconds, boolean useMultiplex
com.google.cloud.spanner.SessionPoolOptions.Builder poolOptionsBuilder =
com.google.cloud.spanner.SessionPoolOptions.newBuilder();
SessionPoolOptionsHelper.setUseMultiplexedSession(poolOptionsBuilder, useMultiplexedSession);
SessionPoolOptionsHelper.setUseMultiplexedSessionBlindWrite(
poolOptionsBuilder, useMultiplexedSession);
SessionPoolOptionsHelper.setUseMultiplexedSessionForRW(
poolOptionsBuilder, useMultiplexedSession);
LOGGER.log(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ public static SessionPoolOptions.Builder setUseMultiplexedSession(
return sessionPoolOptionsBuilder.setUseMultiplexedSession(useMultiplexedSession);
}

// TODO: Remove when multiplexed session for blind write is released.
public static SessionPoolOptions.Builder setUseMultiplexedSessionBlindWrite(
SessionPoolOptions.Builder sessionPoolOptionsBuilder,
boolean useMultiplexedSessionBlindWrite) {
return sessionPoolOptionsBuilder.setUseMultiplexedSessionBlindWrite(
useMultiplexedSessionBlindWrite);
}

// TODO: Remove when multiplexed session for read write is released.
public static SessionPoolOptions.Builder setUseMultiplexedSessionForRW(
SessionPoolOptions.Builder sessionPoolOptionsBuilder, boolean useMultiplexedSessionForRW) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ public class SessionPoolOptions {

private final boolean useMultiplexedSession;

/**
* Controls whether multiplexed session is enabled for blind write or not. This is only used for
* systest soak. TODO: Remove when multiplexed session for blind write is released.
*/
private final boolean useMultiplexedSessionBlindWrite;

private final boolean useMultiplexedSessionForRW;

private final boolean useMultiplexedSessionForPartitionedOps;
Expand Down Expand Up @@ -122,7 +116,6 @@ private SessionPoolOptions(Builder builder) {
(useMultiplexedSessionFromEnvVariable != null)
? useMultiplexedSessionFromEnvVariable
: builder.useMultiplexedSession;
this.useMultiplexedSessionBlindWrite = builder.useMultiplexedSessionBlindWrite;
// useMultiplexedSessionForRW priority => Environment var > private setter > client default
Boolean useMultiplexedSessionForRWFromEnvVariable =
getUseMultiplexedSessionForRWFromEnvVariable();
Expand Down Expand Up @@ -205,7 +198,6 @@ public int hashCode() {
this.inactiveTransactionRemovalOptions,
this.poolMaintainerClock,
this.useMultiplexedSession,
this.useMultiplexedSessionBlindWrite,
this.useMultiplexedSessionForRW,
this.multiplexedSessionMaintenanceDuration);
}
Expand Down Expand Up @@ -349,7 +341,7 @@ public boolean getUseMultiplexedSession() {
@VisibleForTesting
@InternalApi
protected boolean getUseMultiplexedSessionBlindWrite() {
return getUseMultiplexedSession() && useMultiplexedSessionBlindWrite;
return getUseMultiplexedSession();
}

@VisibleForTesting
Expand Down Expand Up @@ -601,9 +593,6 @@ public static class Builder {
// Set useMultiplexedSession to true to make multiplexed session the default.
private boolean useMultiplexedSession = false;

// TODO: Remove when multiplexed session for blind write is released.
private boolean useMultiplexedSessionBlindWrite = false;

// This field controls the default behavior of session management for RW operations in Java
// client.
// Set useMultiplexedSessionForRW to true to make multiplexed session for RW operations the
Expand Down Expand Up @@ -657,7 +646,6 @@ private Builder(SessionPoolOptions options) {
this.randomizePositionQPSThreshold = options.randomizePositionQPSThreshold;
this.inactiveTransactionRemovalOptions = options.inactiveTransactionRemovalOptions;
this.useMultiplexedSession = options.useMultiplexedSession;
this.useMultiplexedSessionBlindWrite = options.useMultiplexedSessionBlindWrite;
this.useMultiplexedSessionForRW = options.useMultiplexedSessionForRW;
this.useMultiplexedSessionPartitionedOps = options.useMultiplexedSessionForPartitionedOps;
this.multiplexedSessionMaintenanceDuration = options.multiplexedSessionMaintenanceDuration;
Expand Down Expand Up @@ -857,17 +845,6 @@ Builder setUseMultiplexedSession(boolean useMultiplexedSession) {
return this;
}

/**
* This method enables multiplexed sessions for blind writes. This method will be removed in the
* future when multiplexed sessions has been made the default for all operations.
*/
@InternalApi
@VisibleForTesting
Builder setUseMultiplexedSessionBlindWrite(boolean useMultiplexedSessionBlindWrite) {
this.useMultiplexedSessionBlindWrite = useMultiplexedSessionBlindWrite;
return this;
}

/**
* Sets whether the client should use multiplexed session for R/W operations or not. This method
* is intentionally package-private and intended for internal use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public void createSpannerInstance() {
.setSessionPoolOption(
SessionPoolOptions.newBuilder()
.setUseMultiplexedSession(true)
.setUseMultiplexedSessionBlindWrite(true)
.setUseMultiplexedSessionForRW(true)
.setUseMultiplexedSessionPartitionedOps(true)
// Set the maintainer to loop once every 1ms
Expand Down

0 comments on commit fae2082

Please sign in to comment.