Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Remove two methods from AbstractComponent #34336

Merged
merged 2 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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