Skip to content

Commit 6132e12

Browse files
authored
feat(tfo): update config naming (#1699)
BREAKING CHANGE: the configuration option has been renamed to highlight the attempt nature of it.
1 parent b2b7507 commit 6132e12

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ public final class Config implements Serializable {
165165

166166
/**
167167
* Defines whether the driver should try using TCP Fast Open if the runtime supports it. This option is ignored
168-
* when the conditions described in {@link ConfigBuilder#withTcpFastOpenEnabled(boolean)} are not met.
168+
* when the conditions described in {@link ConfigBuilder#withTryTcpFastOpen(boolean)} are not met.
169169
* <p>
170170
* <b>This option is experimental.</b>
171171
* @since 6.0.0
172172
*/
173173
@Experimental
174-
private final boolean tcpFastOpenEnabled;
174+
private final boolean tryTcpFastOpen;
175175

176176
private Config(ConfigBuilder builder) {
177177
this.logging = builder.logging;
@@ -195,7 +195,7 @@ private Config(ConfigBuilder builder) {
195195
this.eventLoopThreads = builder.eventLoopThreads;
196196
this.telemetryDisabled = builder.telemetryDisabled;
197197
this.observationProvider = builder.observationProvider;
198-
this.tcpFastOpenEnabled = builder.tcpFastOpenEnabled;
198+
this.tryTcpFastOpen = builder.tryTcpFastOpen;
199199
}
200200

201201
/**
@@ -418,7 +418,7 @@ public Optional<ObservationProvider> observationProvider() {
418418

419419
/**
420420
* Returns whether the driver should try using TCP Fast Open if the runtime supports it. This option is ignored
421-
* when the conditions described in {@link ConfigBuilder#withTcpFastOpenEnabled(boolean)} are not met.
421+
* when the conditions described in {@link ConfigBuilder#withTryTcpFastOpen(boolean)} are not met.
422422
* <p>
423423
* <b>This option is experimental.</b>
424424
* <p>
@@ -428,8 +428,8 @@ public Optional<ObservationProvider> observationProvider() {
428428
* @since 6.0.0
429429
*/
430430
@Experimental
431-
public boolean isTcpFastOpenEnabled() {
432-
return tcpFastOpenEnabled;
431+
public boolean isTryTcpFastOpen() {
432+
return tryTcpFastOpen;
433433
}
434434

435435
/**
@@ -454,7 +454,7 @@ public static final class ConfigBuilder {
454454
private long fetchSize = 1000;
455455
private int eventLoopThreads = 0;
456456
private ObservationProvider observationProvider;
457-
private boolean tcpFastOpenEnabled;
457+
private boolean tryTcpFastOpen;
458458

459459
@SuppressWarnings("deprecation")
460460
private NotificationConfig notificationConfig = NotificationConfig.defaultConfig();
@@ -950,8 +950,8 @@ public ConfigBuilder withTelemetryDisabled(boolean telemetryDisabled) {
950950
* @since 6.0.0
951951
*/
952952
@Experimental
953-
public ConfigBuilder withTcpFastOpenEnabled(boolean enabled) {
954-
this.tcpFastOpenEnabled = enabled;
953+
public ConfigBuilder withTryTcpFastOpen(boolean enabled) {
954+
this.tryTcpFastOpen = enabled;
955955
return this;
956956
}
957957

driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ private BoltConnectionProvider createBoltConnectionProvider(
415415
if (localAddress != null) {
416416
additionalConfig.put("localAddress", localAddress);
417417
}
418-
additionalConfig.put("enableFastOpen", config.isTcpFastOpenEnabled());
418+
additionalConfig.put("enableFastOpen", config.isTryTcpFastOpen());
419419
return boltConnectionProviderFactory.create(
420420
loggingProvider, BoltValueFactory.getInstance(), observationProvider, additionalConfig);
421421
}

0 commit comments

Comments
 (0)