mirror of https://github.com/apache/lucene.git
SOLR-10738: TriggerAction is initialised even if the trigger is never scheduled
This commit is contained in:
parent
cfe5cffddd
commit
b010ebd515
|
@ -107,6 +107,8 @@ Bug Fixes
|
|||
* SOLR-10714: OverseerTriggerThread does not start triggers on overseer start until autoscaling
|
||||
config watcher is fired. (shalin)
|
||||
|
||||
* SOLR-10738: TriggerAction is initialised even if the trigger is never scheduled. (shalin)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ public class NodeAddedTrigger implements AutoScaling.Trigger<NodeAddedTrigger.No
|
|||
actions = new ArrayList<>(3);
|
||||
for (Map<String, String> map : o) {
|
||||
TriggerAction action = container.getResourceLoader().newInstance(map.get("class"), TriggerAction.class);
|
||||
action.init(map);
|
||||
actions.add(action);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -70,7 +70,6 @@ public class NodeLostTrigger implements AutoScaling.Trigger<NodeLostTrigger.Node
|
|||
actions = new ArrayList<>(3);
|
||||
for (Map<String, String> map : o) {
|
||||
TriggerAction action = container.getResourceLoader().newInstance(map.get("class"), TriggerAction.class);
|
||||
action.init(map);
|
||||
actions.add(action);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -143,6 +143,10 @@ public class ScheduledTriggers implements Closeable {
|
|||
return false;
|
||||
}
|
||||
});
|
||||
List<TriggerAction> actions = newTrigger.getActions();
|
||||
for (TriggerAction action : actions) {
|
||||
action.init(newTrigger.getProperties());
|
||||
}
|
||||
scheduledTrigger.scheduledFuture = scheduledThreadPoolExecutor.scheduleWithFixedDelay(scheduledTrigger, 0, DEFAULT_SCHEDULED_TRIGGER_DELAY_SECONDS, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
|
|
|
@ -473,8 +473,7 @@ public class TriggerIntegrationTest extends SolrCloudTestCase {
|
|||
public static class TestTriggerAction implements TriggerAction {
|
||||
|
||||
public TestTriggerAction() {
|
||||
log.info("TestTriggerAction instantiated");
|
||||
actionCreated.countDown();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -507,7 +506,8 @@ public class TriggerIntegrationTest extends SolrCloudTestCase {
|
|||
|
||||
@Override
|
||||
public void init(Map<String, String> args) {
|
||||
|
||||
log.info("TestTriggerAction init");
|
||||
actionCreated.countDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue