Remove redundant config manager start checking

Original commit: elastic/x-pack-elasticsearch@5369765398
This commit is contained in:
Martijn van Groningen 2014-12-05 16:02:28 +01:00
parent 984d7d615a
commit 203cf5c024
2 changed files with 2 additions and 9 deletions

View File

@ -64,7 +64,6 @@ public class AlertsStore extends AbstractComponent {
private final TemplateHelper templateHelper;
private final ConcurrentMap<String, Alert> alertMap;
private final AlertActionRegistry alertActionRegistry;
private final ConfigurationManager configurationManager;
private final AtomicBoolean started = new AtomicBoolean(false);
private final int scrollSize;
@ -72,14 +71,13 @@ public class AlertsStore extends AbstractComponent {
@Inject
public AlertsStore(Settings settings, Client client, AlertActionRegistry alertActionRegistry,
TriggerManager triggerManager, TemplateHelper templateHelper, ConfigurationManager configurationManager) {
TriggerManager triggerManager, TemplateHelper templateHelper) {
super(settings);
this.client = client;
this.alertActionRegistry = alertActionRegistry;
this.templateHelper = templateHelper;
this.alertMap = ConcurrentCollections.newConcurrentMap();
this.triggerManager = triggerManager;
this.configurationManager = configurationManager;
// Not using component settings, to let AlertsStore and AlertActionManager share the same settings
this.scrollTimeout = settings.getAsTime("alerts.scroll.timeout", TimeValue.timeValueSeconds(30));
this.scrollSize = settings.getAsInt("alerts.scroll.size", 100);

View File

@ -67,7 +67,6 @@ public class AlertActionManager extends AbstractComponent {
public static final String ALERT_HISTORY_TYPE = "alerthistory";
private final Client client;
private final ConfigurationManager configurationManager;
private AlertManager alertManager;
private final ThreadPool threadPool;
private final AlertsStore alertsStore;
@ -86,7 +85,7 @@ public class AlertActionManager extends AbstractComponent {
@Inject
public AlertActionManager(Settings settings, Client client, AlertActionRegistry actionRegistry,
ThreadPool threadPool, AlertsStore alertsStore, TriggerManager triggerManager,
TemplateHelper templateHelper, ConfigurationManager configurationManager) {
TemplateHelper templateHelper) {
super(settings);
this.client = client;
this.actionRegistry = actionRegistry;
@ -94,7 +93,6 @@ public class AlertActionManager extends AbstractComponent {
this.alertsStore = alertsStore;
this.triggerManager = triggerManager;
this.templateHelper = templateHelper;
this.configurationManager = configurationManager;
// Not using component settings, to let AlertsStore and AlertActionManager share the same settings
this.scrollTimeout = settings.getAsTime("alerts.scroll.timeout", TimeValue.timeValueSeconds(30));
this.scrollSize = settings.getAsInt("alerts.scroll.size", 100);
@ -109,9 +107,6 @@ public class AlertActionManager extends AbstractComponent {
if (started.get()) {
return true;
}
if (!configurationManager.start(state)) {
return false;
}
String[] indices = state.metaData().concreteIndices(IndicesOptions.lenientExpandOpen(), ALERT_HISTORY_INDEX_PREFIX + "*");
if (indices.length == 0) {