From 959d7e831b542f9e3aa71eef435e0dfd6a9c90b5 Mon Sep 17 00:00:00 2001
From: Alexey Ivanov
- * Note: Only settings registered in {@link org.elasticsearch.cluster.ClusterModule} can be changed dynamically. - *
- */ - public synchronizedtrue iff the value has been updated.
*/
- default boolean apply(Settings current, Settings previous) {
+ default boolean apply(C context, Settings current, Settings previous) {
if (hasChanged(current, previous)) {
T value = getValue(current, previous);
- apply(value, current, previous);
+ apply(context, value, current, previous);
return true;
}
return false;
@@ -658,10 +553,10 @@ default boolean apply(Settings current, Settings previous) {
* actually changed. This allows to defer the update to a later point in time while keeping type safety.
* If the value didn't change the returned runnable is a noop.
*/
- default Runnable updater(Settings current, Settings previous) {
+ default Runnable updater(C context, Settings current, Settings previous) {
if (hasChanged(current, previous)) {
T value = getValue(current, previous);
- return () -> { apply(value, current, previous); };
+ return () -> { apply(context, value, current, previous); };
}
return () -> {};
}
@@ -741,21 +636,6 @@ public Settings diff(Settings source, Settings defaultSettings) {
return builder.build();
}
- /**
- * Returns the value for the given setting.
- */
- public
diff --git a/server/src/main/java/org/elasticsearch/common/settings/BaseSettingsUpdater.java b/server/src/main/java/org/elasticsearch/common/settings/BaseSettingsUpdater.java
index 22ae72019182b..9f587f6adfe2c 100644
--- a/server/src/main/java/org/elasticsearch/common/settings/BaseSettingsUpdater.java
+++ b/server/src/main/java/org/elasticsearch/common/settings/BaseSettingsUpdater.java
@@ -17,10 +17,10 @@
import static org.elasticsearch.common.settings.AbstractScopedSettings.ARCHIVED_SETTINGS_PREFIX;
-public abstract class BaseSettingsUpdater {
- protected final AbstractScopedSettings scopedSettings;
+public abstract class BaseSettingsUpdater
+ * Note: Only settings registered in {@link org.elasticsearch.cluster.ClusterModule} can be changed dynamically.
+ *
+ * Note: Only settings registered in {@link SettingsModule} can be changed dynamically.
+ *