Skip to content

Commit

Permalink
Core: Remove two methods from AbstractComponent (#34336)
Browse files Browse the repository at this point in the history
This removes another two methods from `AbstractComponent`. One isn't
used at all and another is only used in a single class in watcher. I've
moved the method that watcher uses into the single class that uses it.
  • Loading branch information
nik9000 authored and kcm committed Oct 30, 2018
1 parent d9d52e6 commit 08a2006
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.node.Node;
Expand All @@ -44,23 +43,4 @@ public AbstractComponent(Settings settings) {
public final String nodeName() {
return Node.NODE_NAME_SETTING.get(settings);
}

/**
* Checks for a deprecated setting and logs the correct alternative
*/
protected void logDeprecatedSetting(String settingName, String alternativeName) {
if (!Strings.isNullOrEmpty(settings.get(settingName))) {
deprecationLogger.deprecated("Setting [{}] is deprecated, use [{}] instead", settingName, alternativeName);
}
}

/**
* Checks for a removed setting and logs the correct alternative
*/
protected void logRemovedSetting(String settingName, String alternativeName) {
if (!Strings.isNullOrEmpty(settings.get(settingName))) {
deprecationLogger.deprecated("Setting [{}] has been removed, use [{}] instead", settingName, alternativeName);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ public ResourceWatcherService(Settings settings, ThreadPool threadPool) {
mediumMonitor = new ResourceMonitor(interval, Frequency.MEDIUM);
interval = RELOAD_INTERVAL_HIGH.get(settings);
highMonitor = new ResourceMonitor(interval, Frequency.HIGH);

logRemovedSetting("watcher.enabled", "resource.reload.enabled");
logRemovedSetting("watcher.interval", "resource.reload.interval");
logRemovedSetting("watcher.interval.low", "resource.reload.interval.low");
logRemovedSetting("watcher.interval.medium", "resource.reload.interval.medium");
logRemovedSetting("watcher.interval.high", "resource.reload.interval.high");
}

@Override
Expand Down

0 comments on commit 08a2006

Please sign in to comment.