Made marvel.agent.shard_stats.enabled dynamically updatable

Relates to #20
This commit is contained in:
Boaz Leskes 2014-03-04 16:58:43 +01:00 committed by Chris Cowan
parent dd6b0acb49
commit fe16ee700e

View file

@ -124,6 +124,7 @@ public class AgentService extends AbstractLifecycleComponent<AgentService> imple
nodeSettingsService.addListener(this);
dynamicSettings.addDynamicSetting(SETTINGS_INTERVAL);
dynamicSettings.addDynamicSetting(SETTINGS_INDICES + ".*"); // array settings
dynamicSettings.addDynamicSetting(SETTINGS_SHARD_STATS_ENABLED);
}
protected void applyIntervalSettings() {
@ -202,6 +203,12 @@ public class AgentService extends AbstractLifecycleComponent<AgentService> imple
logger.info("sampling indices updated to [{}]", Strings.arrayToCommaDelimitedString(indices));
indicesToExport = indices;
}
Boolean shardsExport = settings.getAsBoolean(SETTINGS_SHARD_STATS_ENABLED, null);
if (shardsExport != null) {
logger.info("updating " + SETTINGS_SHARD_STATS_ENABLED + " to [" + shardsExport + "]");
exportShardStats = shardsExport;
}
}
class ExportingWorker implements Runnable {