Introduced dedicated alerting thread pool, which executes alert actions
Original commit: elastic/x-pack-elasticsearch@e49ecb3f7c
This commit is contained in:
parent
61a28f68e3
commit
5a957ed678
|
@ -16,6 +16,7 @@ import org.elasticsearch.action.update.UpdateRequest;
|
||||||
import org.elasticsearch.alerts.Alert;
|
import org.elasticsearch.alerts.Alert;
|
||||||
import org.elasticsearch.alerts.AlertsStore;
|
import org.elasticsearch.alerts.AlertsStore;
|
||||||
import org.elasticsearch.alerts.LoadingListener;
|
import org.elasticsearch.alerts.LoadingListener;
|
||||||
|
import org.elasticsearch.alerts.plugin.AlertsPlugin;
|
||||||
import org.elasticsearch.alerts.triggers.TriggerManager;
|
import org.elasticsearch.alerts.triggers.TriggerManager;
|
||||||
import org.elasticsearch.alerts.triggers.TriggerResult;
|
import org.elasticsearch.alerts.triggers.TriggerResult;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
|
@ -123,7 +124,7 @@ public class AlertActionManager extends AbstractComponent {
|
||||||
logger.debug("Stopping thread to read from the job queue");
|
logger.debug("Stopping thread to read from the job queue");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new AlertHistoryRunnable(entry));
|
threadPool.executor(AlertsPlugin.THREAD_POOL_NAME).execute(new AlertHistoryRunnable(entry));
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.error("Error during reader thread", t);
|
logger.error("Error during reader thread", t);
|
||||||
|
|
|
@ -17,10 +17,10 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde
|
||||||
|
|
||||||
public class AlertsPlugin extends AbstractPlugin {
|
public class AlertsPlugin extends AbstractPlugin {
|
||||||
|
|
||||||
public static final String NAME = "alerts";
|
public static final String THREAD_POOL_NAME = "alerts";
|
||||||
|
|
||||||
@Override public String name() {
|
@Override public String name() {
|
||||||
return NAME;
|
return THREAD_POOL_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String description() {
|
@Override public String description() {
|
||||||
|
@ -37,7 +37,7 @@ public class AlertsPlugin extends AbstractPlugin {
|
||||||
@Override
|
@Override
|
||||||
public Settings additionalSettings() {
|
public Settings additionalSettings() {
|
||||||
return settingsBuilder()
|
return settingsBuilder()
|
||||||
.put("threadpool."+ NAME + ".type","cached")
|
.put("threadpool."+ THREAD_POOL_NAME + ".type","cached")
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue