From 8b16fdfc05627af7b877645f42ea793f7079682f Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 17 Aug 2015 15:07:36 +0200 Subject: [PATCH] Fixed compile errors due to upstream change: https://github.com/elastic/elasticsearch/commit/008dc8ec31c405600baaadd1129ad76fd6e13bf0 Original commit: elastic/x-pack-elasticsearch@a6e567a5aba1fbbc294ef873d415b28b104ea20f --- .../elasticsearch/marvel/MarvelPlugin.java | 23 +++++++++++++++++++ .../marvel/agent/AgentService.java | 6 ----- .../marvel/agent/exporter/HttpESExporter.java | 9 -------- .../agent/settings/MarvelSettingsService.java | 12 +--------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/marvel/src/main/java/org/elasticsearch/marvel/MarvelPlugin.java b/marvel/src/main/java/org/elasticsearch/marvel/MarvelPlugin.java index 1530fd150cf..b27771c9045 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/MarvelPlugin.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/MarvelPlugin.java @@ -7,12 +7,16 @@ package org.elasticsearch.marvel; import com.google.common.collect.ImmutableList; import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.ClusterModule; +import org.elasticsearch.cluster.settings.Validator; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.marvel.agent.AgentService; +import org.elasticsearch.marvel.agent.exporter.HttpESExporter; +import org.elasticsearch.marvel.agent.settings.MarvelSettingsService; import org.elasticsearch.marvel.license.LicenseService; import org.elasticsearch.plugins.AbstractPlugin; import org.elasticsearch.tribe.TribeService; @@ -75,4 +79,23 @@ public class MarvelPlugin extends AbstractPlugin { } return settings.getAsBoolean(ENABLED, true); } + + public void onModule(ClusterModule module) { + // AgentService + module.registerClusterDynamicSetting(AgentService.SETTINGS_INTERVAL, Validator.EMPTY); + module.registerClusterDynamicSetting(AgentService.SETTINGS_STATS_TIMEOUT, Validator.EMPTY); + // HttpESExporter + module.registerClusterDynamicSetting(HttpESExporter.SETTINGS_HOSTS, Validator.EMPTY); + module.registerClusterDynamicSetting(HttpESExporter.SETTINGS_HOSTS + ".*", Validator.EMPTY); + module.registerClusterDynamicSetting(HttpESExporter.SETTINGS_TIMEOUT, Validator.EMPTY); + module.registerClusterDynamicSetting(HttpESExporter.SETTINGS_READ_TIMEOUT, Validator.EMPTY); + module.registerClusterDynamicSetting(HttpESExporter.SETTINGS_SSL_HOSTNAME_VERIFICATION, Validator.EMPTY); + // MarvelSettingsService + module.registerClusterDynamicSetting(MarvelSettingsService.CLUSTER_STATE_TIMEOUT, Validator.EMPTY); + module.registerClusterDynamicSetting(MarvelSettingsService.CLUSTER_STATS_TIMEOUT, Validator.EMPTY); + module.registerClusterDynamicSetting(MarvelSettingsService.INDEX_RECOVERY_ACTIVE_ONLY, Validator.EMPTY); + module.registerClusterDynamicSetting(MarvelSettingsService.INDEX_RECOVERY_TIMEOUT, Validator.EMPTY); + module.registerClusterDynamicSetting(MarvelSettingsService.INDICES, Validator.EMPTY); + module.registerClusterDynamicSetting(MarvelSettingsService.INDEX_STATS_TIMEOUT, Validator.EMPTY); + } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java index 729b8be70b6..d3534bdb987 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java @@ -6,8 +6,6 @@ package org.elasticsearch.marvel.agent; import com.google.common.collect.ImmutableSet; -import org.elasticsearch.cluster.settings.ClusterDynamicSettings; -import org.elasticsearch.cluster.settings.DynamicSettings; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; @@ -43,7 +41,6 @@ public class AgentService extends AbstractLifecycleComponent imple @Inject public AgentService(Settings settings, NodeSettingsService nodeSettingsService, - @ClusterDynamicSettings DynamicSettings dynamicSettings, LicenseService licenseService, Set collectors, Set exporters) { super(settings); @@ -61,9 +58,6 @@ public class AgentService extends AbstractLifecycleComponent imple } nodeSettingsService.addListener(this); - dynamicSettings.addDynamicSetting(SETTINGS_INTERVAL); - dynamicSettings.addDynamicSetting(SETTINGS_STATS_TIMEOUT); - logger.trace("marvel is running in [{}] mode", licenseService.mode()); } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/HttpESExporter.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/HttpESExporter.java index 721f5f05ba0..8ba4e474ea6 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/HttpESExporter.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/HttpESExporter.java @@ -9,8 +9,6 @@ import com.google.common.io.ByteStreams; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterService; -import org.elasticsearch.cluster.settings.ClusterDynamicSettings; -import org.elasticsearch.cluster.settings.DynamicSettings; import org.elasticsearch.common.Base64; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Strings; @@ -102,7 +100,6 @@ public class HttpESExporter extends AbstractExporter implements @Inject public HttpESExporter(Settings settings, ClusterService clusterService, ClusterName clusterName, - @ClusterDynamicSettings DynamicSettings dynamicSettings, NodeSettingsService nodeSettingsService, NodeService nodeService, Environment environment, RendererRegistry registry) { @@ -132,12 +129,6 @@ public class HttpESExporter extends AbstractExporter implements bulkTimeout = settings.getAsTime(SETTINGS_CHECK_TEMPLATE_TIMEOUT, null); keepAliveWorker = new ConnectionKeepAliveWorker(); - - dynamicSettings.addDynamicSetting(SETTINGS_HOSTS); - dynamicSettings.addDynamicSetting(SETTINGS_HOSTS + ".*"); - dynamicSettings.addDynamicSetting(SETTINGS_TIMEOUT); - dynamicSettings.addDynamicSetting(SETTINGS_READ_TIMEOUT); - dynamicSettings.addDynamicSetting(SETTINGS_SSL_HOSTNAME_VERIFICATION); nodeSettingsService.addListener(this); if (!settings.getByPrefix(SETTINGS_SSL_PREFIX).getAsMap().isEmpty()) { diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java index 54ae0b99051..a302f72c89c 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsService.java @@ -6,8 +6,6 @@ package org.elasticsearch.marvel.agent.settings; import com.google.common.collect.ImmutableList; -import org.elasticsearch.cluster.settings.ClusterDynamicSettings; -import org.elasticsearch.cluster.settings.DynamicSettings; import org.elasticsearch.common.Strings; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.inject.Inject; @@ -75,17 +73,9 @@ public class MarvelSettingsService extends AbstractComponent implements NodeSett } @Inject - public MarvelSettingsService(Settings clusterSettings, NodeSettingsService nodeSettingsService, @ClusterDynamicSettings DynamicSettings dynamicSettings) { + public MarvelSettingsService(Settings clusterSettings, NodeSettingsService nodeSettingsService) { this(clusterSettings); - logger.trace("registering dynamic marvel settings:"); - for (MarvelSetting setting : settings) { - if (setting.isDynamic()) { - logger.trace("dynamic setting [{}] registered", setting.getName()); - dynamicSettings.addDynamicSetting(setting.dynamicSettingName()); - } - } - logger.trace("registering the service as a node settings listener"); nodeSettingsService.addListener(this); }