Introduced dedicated alerting thread pool, which executes alert actions

Original commit: elastic/x-pack-elasticsearch@e49ecb3f7c
This commit is contained in:
Martijn van Groningen 2014-11-05 16:08:27 +01:00
parent 61a28f68e3
commit 5a957ed678
2 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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();
}