Skip to content

Commit acc08c0

Browse files
committed
JAVA-2841: substitute all defaults that references the initQueryTimeout
1 parent 5b506b5 commit acc08c0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

core/src/main/java/com/datastax/oss/driver/api/core/config/OptionsMap.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ private void readObject(ObjectInputStream stream) throws InvalidObjectException
243243

244244
protected static void fillWithDriverDefaults(OptionsMap map) {
245245
// Sorted by order of appearance in reference.conf:
246+
Duration initQueryTimeout = Duration.ofSeconds(5);
246247

247248
// Skip CONFIG_RELOAD_INTERVAL because the map-based config doesn't need periodic reloading
248249
map.put(TypedDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(2));
@@ -255,8 +256,8 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
255256
map.put(TypedDriverOption.LOAD_BALANCING_POLICY_SLOW_AVOIDANCE, true);
256257
map.put(TypedDriverOption.SESSION_LEAK_THRESHOLD, 4);
257258
map.put(TypedDriverOption.CONNECTION_CONNECT_TIMEOUT, Duration.ofSeconds(5));
258-
map.put(TypedDriverOption.CONNECTION_INIT_QUERY_TIMEOUT, Duration.ofSeconds(5));
259-
map.put(TypedDriverOption.CONNECTION_SET_KEYSPACE_TIMEOUT, Duration.ofMillis(500));
259+
map.put(TypedDriverOption.CONNECTION_INIT_QUERY_TIMEOUT, initQueryTimeout);
260+
map.put(TypedDriverOption.CONNECTION_SET_KEYSPACE_TIMEOUT, initQueryTimeout);
260261
map.put(TypedDriverOption.CONNECTION_POOL_LOCAL_SIZE, 1);
261262
map.put(TypedDriverOption.CONNECTION_POOL_REMOTE_SIZE, 1);
262263
map.put(TypedDriverOption.CONNECTION_MAX_REQUESTS, 1024);
@@ -323,7 +324,7 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
323324
map.put(TypedDriverOption.METRICS_NODE_GRAPH_MESSAGES_INTERVAL, Duration.ofMinutes(5));
324325
map.put(TypedDriverOption.SOCKET_TCP_NODELAY, true);
325326
map.put(TypedDriverOption.HEARTBEAT_INTERVAL, Duration.ofSeconds(30));
326-
map.put(TypedDriverOption.HEARTBEAT_TIMEOUT, Duration.ofMillis(500));
327+
map.put(TypedDriverOption.HEARTBEAT_TIMEOUT, initQueryTimeout);
327328
map.put(TypedDriverOption.METADATA_TOPOLOGY_WINDOW, Duration.ofSeconds(1));
328329
map.put(TypedDriverOption.METADATA_TOPOLOGY_MAX_EVENTS, 20);
329330
map.put(TypedDriverOption.METADATA_SCHEMA_ENABLED, true);
@@ -332,7 +333,7 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
332333
map.put(TypedDriverOption.METADATA_SCHEMA_WINDOW, Duration.ofSeconds(1));
333334
map.put(TypedDriverOption.METADATA_SCHEMA_MAX_EVENTS, 20);
334335
map.put(TypedDriverOption.METADATA_TOKEN_MAP_ENABLED, true);
335-
map.put(TypedDriverOption.CONTROL_CONNECTION_TIMEOUT, Duration.ofMillis(500));
336+
map.put(TypedDriverOption.CONTROL_CONNECTION_TIMEOUT, initQueryTimeout);
336337
map.put(TypedDriverOption.CONTROL_CONNECTION_AGREEMENT_INTERVAL, Duration.ofMillis(200));
337338
map.put(TypedDriverOption.CONTROL_CONNECTION_AGREEMENT_TIMEOUT, Duration.ofSeconds(10));
338339
map.put(TypedDriverOption.CONTROL_CONNECTION_AGREEMENT_WARN, true);
@@ -341,7 +342,7 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
341342
map.put(TypedDriverOption.REPREPARE_CHECK_SYSTEM_TABLE, false);
342343
map.put(TypedDriverOption.REPREPARE_MAX_STATEMENTS, 0);
343344
map.put(TypedDriverOption.REPREPARE_MAX_PARALLELISM, 100);
344-
map.put(TypedDriverOption.REPREPARE_TIMEOUT, Duration.ofMillis(500));
345+
map.put(TypedDriverOption.REPREPARE_TIMEOUT, initQueryTimeout);
345346
map.put(TypedDriverOption.NETTY_DAEMON, false);
346347
map.put(TypedDriverOption.NETTY_IO_SIZE, 0);
347348
map.put(TypedDriverOption.NETTY_IO_SHUTDOWN_QUIET_PERIOD, 2);

0 commit comments

Comments
 (0)