@@ -74,8 +74,6 @@ public class SessionPoolOptions {
74
74
75
75
private final boolean useMultiplexedSession ;
76
76
77
- private final boolean useRandomChannelHint ;
78
-
79
77
// TODO: Change to use java.time.Duration.
80
78
private final Duration multiplexedSessionMaintenanceDuration ;
81
79
@@ -110,7 +108,6 @@ private SessionPoolOptions(Builder builder) {
110
108
builder .useMultiplexedSession
111
109
&& !Boolean .parseBoolean (
112
110
System .getenv ("GOOGLE_CLOUD_SPANNER_FORCE_DISABLE_MULTIPLEXED_SESSIONS" ));
113
- this .useRandomChannelHint = builder .useRandomChannelHint ;
114
111
this .multiplexedSessionMaintenanceDuration = builder .multiplexedSessionMaintenanceDuration ;
115
112
}
116
113
@@ -147,7 +144,6 @@ public boolean equals(Object o) {
147
144
this .inactiveTransactionRemovalOptions , other .inactiveTransactionRemovalOptions )
148
145
&& Objects .equals (this .poolMaintainerClock , other .poolMaintainerClock )
149
146
&& Objects .equals (this .useMultiplexedSession , other .useMultiplexedSession )
150
- && Objects .equals (this .useRandomChannelHint , other .useRandomChannelHint )
151
147
&& Objects .equals (
152
148
this .multiplexedSessionMaintenanceDuration ,
153
149
other .multiplexedSessionMaintenanceDuration );
@@ -178,7 +174,6 @@ public int hashCode() {
178
174
this .inactiveTransactionRemovalOptions ,
179
175
this .poolMaintainerClock ,
180
176
this .useMultiplexedSession ,
181
- this .useRandomChannelHint ,
182
177
this .multiplexedSessionMaintenanceDuration );
183
178
}
184
179
@@ -312,10 +307,6 @@ public boolean getUseMultiplexedSession() {
312
307
return useMultiplexedSession ;
313
308
}
314
309
315
- boolean isUseRandomChannelHint () {
316
- return useRandomChannelHint ;
317
- }
318
-
319
310
Duration getMultiplexedSessionMaintenanceDuration () {
320
311
return multiplexedSessionMaintenanceDuration ;
321
312
}
@@ -350,24 +341,24 @@ enum ActionOnInactiveTransaction {
350
341
static class InactiveTransactionRemovalOptions {
351
342
352
343
/** Option to set the behaviour when there are inactive transactions. */
353
- private ActionOnInactiveTransaction actionOnInactiveTransaction ;
344
+ private final ActionOnInactiveTransaction actionOnInactiveTransaction ;
354
345
355
346
/**
356
347
* Frequency for closing inactive transactions. Between two consecutive task executions, it's
357
348
* ensured that the duration is greater or equal to this duration.
358
349
*/
359
- private Duration executionFrequency ;
350
+ private final Duration executionFrequency ;
360
351
361
352
/**
362
353
* Long-running transactions will be cleaned up if utilisation is greater than the below value.
363
354
*/
364
- private double usedSessionsRatioThreshold ;
355
+ private final double usedSessionsRatioThreshold ;
365
356
366
357
/**
367
358
* A transaction is considered to be idle if it has not been used for a duration greater than
368
359
* the below value.
369
360
*/
370
- private Duration idleTimeThreshold ;
361
+ private final Duration idleTimeThreshold ;
371
362
372
363
InactiveTransactionRemovalOptions (final Builder builder ) {
373
364
this .actionOnInactiveTransaction = builder .actionOnInactiveTransaction ;
@@ -509,7 +500,7 @@ public static class Builder {
509
500
private boolean autoDetectDialect = false ;
510
501
private Duration waitForMinSessions = Duration .ZERO ;
511
502
private Duration acquireSessionTimeout = Duration .ofSeconds (60 );
512
- private Position releaseToPosition = getReleaseToPositionFromSystemProperty ();
503
+ private final Position releaseToPosition = getReleaseToPositionFromSystemProperty ();
513
504
/**
514
505
* The session pool will randomize the position of a session that is being returned when this
515
506
* threshold is exceeded. That is: If the transactions per second exceeds this threshold, then
@@ -520,8 +511,6 @@ public static class Builder {
520
511
521
512
private boolean useMultiplexedSession = getUseMultiplexedSessionFromEnvVariable ();
522
513
523
- private boolean useRandomChannelHint ;
524
-
525
514
private Duration multiplexedSessionMaintenanceDuration = Duration .ofDays (7 );
526
515
private Clock poolMaintainerClock = Clock .INSTANCE ;
527
516
@@ -760,11 +749,6 @@ Builder setUseMultiplexedSession(boolean useMultiplexedSession) {
760
749
return this ;
761
750
}
762
751
763
- Builder setUseRandomChannelHint (boolean useRandomChannelHint ) {
764
- this .useRandomChannelHint = useRandomChannelHint ;
765
- return this ;
766
- }
767
-
768
752
@ VisibleForTesting
769
753
Builder setMultiplexedSessionMaintenanceDuration (
770
754
Duration multiplexedSessionMaintenanceDuration ) {
@@ -878,11 +862,6 @@ public Builder setAcquireSessionTimeout(Duration acquireSessionTimeout) {
878
862
return this ;
879
863
}
880
864
881
- Builder setReleaseToPosition (Position releaseToPosition ) {
882
- this .releaseToPosition = Preconditions .checkNotNull (releaseToPosition );
883
- return this ;
884
- }
885
-
886
865
Builder setRandomizePositionQPSThreshold (long randomizePositionQPSThreshold ) {
887
866
Preconditions .checkArgument (
888
867
randomizePositionQPSThreshold >= 0L , "randomizePositionQPSThreshold must be >= 0" );
0 commit comments