From 5a957ed678dda9f59d38bb3a473def8a1124ecd5 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 5 Nov 2014 16:08:27 +0100 Subject: [PATCH] Introduced dedicated alerting thread pool, which executes alert actions Original commit: elastic/x-pack-elasticsearch@e49ecb3f7c7b0e18e5945e138c6e43db44535342 --- .../elasticsearch/alerts/actions/AlertActionManager.java | 3 ++- .../java/org/elasticsearch/alerts/plugin/AlertsPlugin.java | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/elasticsearch/alerts/actions/AlertActionManager.java b/src/main/java/org/elasticsearch/alerts/actions/AlertActionManager.java index 8d8f276ad99..173b2f6560e 100644 --- a/src/main/java/org/elasticsearch/alerts/actions/AlertActionManager.java +++ b/src/main/java/org/elasticsearch/alerts/actions/AlertActionManager.java @@ -16,6 +16,7 @@ import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.alerts.Alert; import org.elasticsearch.alerts.AlertsStore; import org.elasticsearch.alerts.LoadingListener; +import org.elasticsearch.alerts.plugin.AlertsPlugin; import org.elasticsearch.alerts.triggers.TriggerManager; import org.elasticsearch.alerts.triggers.TriggerResult; import org.elasticsearch.client.Client; @@ -123,7 +124,7 @@ public class AlertActionManager extends AbstractComponent { logger.debug("Stopping thread to read from the job queue"); return; } - threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new AlertHistoryRunnable(entry)); + threadPool.executor(AlertsPlugin.THREAD_POOL_NAME).execute(new AlertHistoryRunnable(entry)); } } catch (Throwable t) { logger.error("Error during reader thread", t); diff --git a/src/main/java/org/elasticsearch/alerts/plugin/AlertsPlugin.java b/src/main/java/org/elasticsearch/alerts/plugin/AlertsPlugin.java index e289d22780a..8f30de75192 100644 --- a/src/main/java/org/elasticsearch/alerts/plugin/AlertsPlugin.java +++ b/src/main/java/org/elasticsearch/alerts/plugin/AlertsPlugin.java @@ -17,10 +17,10 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde public class AlertsPlugin extends AbstractPlugin { - public static final String NAME = "alerts"; + public static final String THREAD_POOL_NAME = "alerts"; @Override public String name() { - return NAME; + return THREAD_POOL_NAME; } @Override public String description() { @@ -37,7 +37,7 @@ public class AlertsPlugin extends AbstractPlugin { @Override public Settings additionalSettings() { return settingsBuilder() - .put("threadpool."+ NAME + ".type","cached") + .put("threadpool."+ THREAD_POOL_NAME + ".type","cached") .build(); }