Core: Remove two methods from AbstractComponent (#34336)

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.
This commit is contained in:
Nik Everett 2018-10-15 16:05:14 -04:00 committed by GitHub
parent 0cd03d3581
commit 23ece922c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 26 deletions

View File

@ -21,7 +21,6 @@ package org.elasticsearch.common.component;
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;
@ -44,23 +43,4 @@ public abstract class AbstractComponent {
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);
}
}
}

View File

@ -97,12 +97,6 @@ public class ResourceWatcherService extends AbstractLifecycleComponent {
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