Skip to content

Commit 96c32c8

Browse files
committed
Update configuration property names to match latest in lettuce
1 parent 852d223 commit 96c32c8

File tree

5 files changed

+26
-29
lines changed

5 files changed

+26
-29
lines changed

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
<dependency>
4848
<groupId>io.lettuce</groupId>
4949
<artifactId>lettuce-core</artifactId>
50-
<version>6.6.0.RELEASE</version>
51-
<!--<version>6.6.0.BUILD-SNAPSHOT</version> -->
50+
<version>7.0.0-SNAPSHOT</version>
5251
</dependency>
5352
<dependency>
5453
<groupId>com.fasterxml.jackson.dataformat</groupId>

runner-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runner:
3939
commandLatencyMonitoring: true # Enables Lettuce internal command latency monitoring
4040
connectionMonitoring: true # Enables Additional metrics for connection inactive time. Note supported with GA build of lettuce, and required custom Lettuce client build. See README.md for instruction ho to enable them
4141
autoReconnect: true
42-
proactiveRebind: false
42+
supportMaintenanceEvents: false
4343
#reconnectOptions:
4444
# fixedDelay: PT1S # 1s Configures constant delay between re-connection attempts
4545
#pingBeforeActivate: false
@@ -48,7 +48,7 @@ runner:
4848
#disconnectedBehavior: REJECT_COMMANDS #Options: DEFAULT, ACCEPT_COMMANDS, REJECT_COMMANDS
4949
#timeoutOptions: # Options to configure command timeouts
5050
# fixedTimeout: PT1S # 1 s
51-
# proactiveTimeoutsRelaxing: PT0.500S # 500 ms
51+
# timeoutsRelaxingDuringMaintenance: PT0.500S # 500 ms
5252
#socketOptions: # Options to configure low-level socket options for the connections kept to Redis servers.
5353
# connectTimeout: PT10S # 10 s
5454
# tcpUserTimeoutOptions:

src/main/java/io/lettuce/test/WorkloadRunnerBase.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ protected ClientOptions createClientOptions(ClientOptionsConfig config) {
297297
builder.autoReconnect(config.getAutoReconnect());
298298
}
299299

300-
if (config.getProactiveRebind() != null) {
301-
OptionalClientOptions.applyProactiveRebindOption(builder, config.getProactiveRebind());
300+
if (config.getSupportMaintenanceEvents() != null) {
301+
OptionalClientOptions.applySupportMaintenanceEventsOption(builder, config.getSupportMaintenanceEvents());
302302
}
303303

304304
if (config.getPingBeforeActivate() != null) {
@@ -330,16 +330,16 @@ private void applyTimeoutOptions(TimeoutOptions.Builder builder, TimeoutOptionsC
330330
builder.fixedTimeout(config.getFixedTimeout());
331331
}
332332

333-
if (config.getProactiveTimeoutsRelaxing() != null) {
333+
if (config.getTimeoutsRelaxingDuringMaintenance() != null) {
334334
try {
335-
Method proactiveTimeoutsRelaxingMethod = builder.getClass().getMethod("proactiveTimeoutsRelaxing",
335+
Method timeoutsRelaxingDuringMaintenance = builder.getClass().getMethod("timeoutsRelaxingDuringMaintenance",
336336
Duration.class);
337-
proactiveTimeoutsRelaxingMethod.invoke(builder, config.getProactiveTimeoutsRelaxing());
337+
timeoutsRelaxingDuringMaintenance.invoke(builder, config.getTimeoutsRelaxingDuringMaintenance());
338338
log.info("ProactiveTimeoutsRelaxingMethod enabled successfully.");
339339
} catch (NoSuchMethodException e) {
340-
throw new IllegalStateException("The method 'proactiveTimeoutsRelaxing' is not available in this build.", e);
340+
throw new IllegalStateException("The method 'timeoutsRelaxingDuringMaintenance' is not available in this build.", e);
341341
} catch (IllegalAccessException | InvocationTargetException e) {
342-
throw new RuntimeException("Failed to invoke 'proactiveTimeoutsRelaxing' method.", e);
342+
throw new RuntimeException("Failed to invoke 'timeoutsRelaxingDuringMaintenance' method.", e);
343343
}
344344
}
345345
}
@@ -387,15 +387,13 @@ private void applyKeepAliveOptions(SocketOptions.KeepAliveOptions.Builder builde
387387

388388
static class OptionalClientOptions {
389389

390-
private static final Logger log = LoggerFactory.getLogger(OptionalClientOptions.class);
391-
392-
static public void applyProactiveRebindOption(ClientOptions.Builder builder, boolean value) {
390+
static public void applySupportMaintenanceEventsOption(ClientOptions.Builder builder, boolean value) {
393391
try {
394-
Method method = builder.getClass().getMethod("proactiveRebind", boolean.class);
392+
Method method = builder.getClass().getMethod("supportMaintenanceEvents", boolean.class);
395393
method.invoke(builder, value);
396394
} catch (NoSuchMethodException e) {
397395
throw new IllegalStateException(
398-
"proactiveRebind configuration option can't be applied. Not available in this build.", e);
396+
"supportMaintenanceEvents configuration option can't be applied. Not available in this build.", e);
399397
} catch (IllegalAccessException | InvocationTargetException e) {
400398
throw new RuntimeException("Failed to configure proactiveRebind option.", e);
401399
}

src/main/java/io/lettuce/test/config/WorkloadRunnerConfig.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public static class ClientOptionsConfig {
363363

364364
private Boolean autoReconnect;
365365

366-
private Boolean proactiveRebind;
366+
private Boolean supportMaintenanceEvents;
367367

368368
private Boolean pingBeforeActivate;
369369

@@ -388,12 +388,12 @@ public void setAutoReconnect(Boolean autoReconnect) {
388388
this.autoReconnect = autoReconnect;
389389
}
390390

391-
public Boolean getProactiveRebind() {
392-
return proactiveRebind;
391+
public Boolean getSupportMaintenanceEvents() {
392+
return supportMaintenanceEvents;
393393
}
394394

395-
public void setProactiveRebind(Boolean proactiveRebind) {
396-
this.proactiveRebind = proactiveRebind;
395+
public void setSupportMaintenanceEvents(Boolean supportMaintenanceEvents) {
396+
this.supportMaintenanceEvents = supportMaintenanceEvents;
397397
}
398398

399399
public Boolean getPingBeforeActivate() {
@@ -446,7 +446,7 @@ public void setReconnectOptions(ReconnectOptionsConfig reconnectOptions) {
446446

447447
@Override
448448
public String toString() {
449-
return "ClientOptionsConfig{" + "autoReconnect=" + autoReconnect + ", proactiveRebind=" + proactiveRebind
449+
return "ClientOptionsConfig{" + "autoReconnect=" + autoReconnect + ", proactiveRebind=" + supportMaintenanceEvents
450450
+ ", pingBeforeActivate=" + pingBeforeActivate + ", requestQueueSize=" + requestQueueSize
451451
+ ", timeoutOptions=" + timeoutOptions + ", socketOptions=" + socketOptions + ", disconnectedBehavior='"
452452
+ disconnectedBehavior + '\'' + ", reconnectOptions=" + reconnectOptions + '}';
@@ -510,7 +510,7 @@ public static class TimeoutOptionsConfig {
510510

511511
private Duration fixedTimeout;
512512

513-
private Duration proactiveTimeoutsRelaxing;
513+
private Duration timeoutsRelaxingDuringMaintenance;
514514

515515
// Getters and Setters
516516
public Duration getFixedTimeout() {
@@ -521,18 +521,18 @@ public void setFixedTimeout(Duration fixedTimeout) {
521521
this.fixedTimeout = fixedTimeout;
522522
}
523523

524-
public Duration getProactiveTimeoutsRelaxing() {
525-
return proactiveTimeoutsRelaxing;
524+
public Duration getTimeoutsRelaxingDuringMaintenance() {
525+
return timeoutsRelaxingDuringMaintenance;
526526
}
527527

528-
public void setProactiveTimeoutsRelaxing(Duration proactiveTimeoutsRelaxing) {
529-
this.proactiveTimeoutsRelaxing = proactiveTimeoutsRelaxing;
528+
public void setTimeoutsRelaxingDuringMaintenance(Duration timeoutsRelaxingDuringMaintenance) {
529+
this.timeoutsRelaxingDuringMaintenance = timeoutsRelaxingDuringMaintenance;
530530
}
531531

532532
@Override
533533
public String toString() {
534534
return "TimeoutOptionsConfig{" + "fixedTimeout=" + fixedTimeout + ",proactiveExpiryRelaxTime="
535-
+ proactiveTimeoutsRelaxing + '}';
535+
+ timeoutsRelaxingDuringMaintenance + '}';
536536
}
537537

538538
}

src/main/resources/runner-config-defaults.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runner:
3535

3636
#clientOptions:
3737
#autoReconnect: true
38-
#proactiveRebind: false
38+
#supportMaintenanceEvents: false
3939
#reconnectOptions:
4040
# fixedDelay: PT1S # 1s Configures constant delay between re-connection attempts
4141
# proactiveTimeoutsRelaxing: PT0.500S # 500 ms

0 commit comments

Comments
 (0)