diff --git a/server/src/main/java/org/opensearch/common/settings/Setting.java b/server/src/main/java/org/opensearch/common/settings/Setting.java index 289917e386d96..aae5b3a4cb5f2 100644 --- a/server/src/main/java/org/opensearch/common/settings/Setting.java +++ b/server/src/main/java/org/opensearch/common/settings/Setting.java @@ -1822,22 +1822,16 @@ public static Setting timeSetting(String key, Setting fall return new Setting<>(key, fallbackSetting, (s) -> TimeValue.parseTimeValue(s, key), properties); } - public static Setting timeSetting(String key, Setting fallBackSetting, Validator validator, - Property... properties) { - return new Setting<>(new SimpleKey(key), fallBackSetting, fallBackSetting::getRaw, (s) -> TimeValue.parseTimeValue(s, key), - validator, properties); + public static Setting timeSetting(String key, Setting fallBackSetting, Validator validator, Property... properties) { + return new Setting<>(new SimpleKey(key), fallBackSetting, fallBackSetting::getRaw, (s) -> TimeValue.parseTimeValue(s, key), validator, properties); } public static Setting positiveTimeSetting(String key, TimeValue defaultValue, Property... properties) { return timeSetting(key, defaultValue, TimeValue.timeValueMillis(0), properties); } - public static Setting positiveTimeSetting( - final String key, - final Setting fallbackSetting, - final TimeValue minValue, - final Property... properties) { - return timeSetting(key, fallbackSetting, minValue, properties); + public static Setting positiveTimeSetting(final String key, final Setting fallbackSetting, final Property... properties) { + return timeSetting(key, fallbackSetting, TimeValue.timeValueMillis(0), properties); } @Override diff --git a/server/src/main/java/org/opensearch/script/ScriptService.java b/server/src/main/java/org/opensearch/script/ScriptService.java index 622c23ed76ba4..af4dae88ed786 100644 --- a/server/src/main/java/org/opensearch/script/ScriptService.java +++ b/server/src/main/java/org/opensearch/script/ScriptService.java @@ -106,8 +106,7 @@ public class ScriptService implements Closeable, ClusterStateApplier { public static final Setting.AffixSetting SCRIPT_CACHE_EXPIRE_SETTING = Setting.affixKeySetting(CONTEXT_PREFIX, "cache_expire", - key -> Setting.positiveTimeSetting(key, SCRIPT_GENERAL_CACHE_EXPIRE_SETTING, TimeValue.timeValueMillis(0), - Property.NodeScope, Property.Dynamic)); + key -> Setting.positiveTimeSetting(key, SCRIPT_GENERAL_CACHE_EXPIRE_SETTING, Property.NodeScope, Property.Dynamic)); // Unlimited compilation rate for context-specific script caches static final String UNLIMITED_COMPILATION_RATE_KEY = "unlimited"; diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java index e19a8eab3915e..1b792df8ec4e3 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java @@ -100,7 +100,6 @@ public final class RemoteClusterService extends RemoteClusterAware implements Cl Setting.positiveTimeSetting( "cluster.remote.initial_connect_timeout", SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING, // the default needs to be thirty seconds when fallback is removed - TimeValue.timeValueSeconds(30), Setting.Property.NodeScope); public static final Setting SEARCH_REMOTE_NODE_ATTRIBUTE =