lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject lucene-solr:feature/autoscaling: SOLR-10738: TriggerAction is initialised even if the trigger is never scheduled
Date Wed, 24 May 2017 09:08:25 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/feature/autoscaling cfe5cffdd -> b010ebd51


SOLR-10738: TriggerAction is initialised even if the trigger is never scheduled


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b010ebd5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b010ebd5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b010ebd5

Branch: refs/heads/feature/autoscaling
Commit: b010ebd515a7b97b5efd588d214997e08cb71c95
Parents: cfe5cff
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Wed May 24 14:38:26 2017 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Wed May 24 14:38:26 2017 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                               | 2 ++
 .../org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java    | 1 -
 .../org/apache/solr/cloud/autoscaling/NodeLostTrigger.java     | 1 -
 .../org/apache/solr/cloud/autoscaling/ScheduledTriggers.java   | 4 ++++
 .../apache/solr/cloud/autoscaling/TriggerIntegrationTest.java  | 6 +++---
 5 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b010ebd5/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ecfeedc..5166da7 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -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
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b010ebd5/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java
index 5a340be..1754a8b 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java
@@ -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 {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b010ebd5/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeLostTrigger.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeLostTrigger.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeLostTrigger.java
index 385eca5..8bca93c 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeLostTrigger.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/NodeLostTrigger.java
@@ -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 {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b010ebd5/solr/core/src/java/org/apache/solr/cloud/autoscaling/ScheduledTriggers.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/ScheduledTriggers.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/ScheduledTriggers.java
index 8dfbddf..9c18ac2 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/ScheduledTriggers.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/ScheduledTriggers.java
@@ -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);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b010ebd5/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java
b/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java
index 0ac8183..db15f6c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java
@@ -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();
     }
   }
 }


Mime
View raw message