lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject lucene-solr:feature/autoscaling: Fix string / boolean conversions and fix an assertion that is no longer true due to .auto_add_replicas trigger.
Date Mon, 31 Jul 2017 13:39:40 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/feature/autoscaling 7ef991d64 -> 77a5dfe38


Fix string / boolean conversions and fix an assertion that is no longer true
due to .auto_add_replicas trigger.


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

Branch: refs/heads/feature/autoscaling
Commit: 77a5dfe381f3f58c3df0fa5269afade22be28361
Parents: 7ef991d
Author: Andrzej Bialecki <ab@apache.org>
Authored: Mon Jul 31 15:38:50 2017 +0200
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Mon Jul 31 15:38:50 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/solr/cloud/autoscaling/NodeAddedTrigger.java   | 2 +-
 .../java/org/apache/solr/cloud/autoscaling/NodeLostTrigger.java    | 2 +-
 .../org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77a5dfe3/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 2197dd0..77e42af 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
@@ -85,7 +85,7 @@ public class NodeAddedTrigger extends TriggerBase {
     }
     lastLiveNodes = new HashSet<>(container.getZkController().getZkStateReader().getClusterState().getLiveNodes());
     log.debug("Initial livenodes: {}", lastLiveNodes);
-    this.enabled = (boolean) properties.getOrDefault("enabled", true);
+    this.enabled = Boolean.parseBoolean(String.valueOf(properties.getOrDefault("enabled",
"true")));
     this.waitForSecond = ((Long) properties.getOrDefault("waitFor", -1L)).intValue();
     this.eventType = TriggerEventType.valueOf(properties.get("event").toString().toUpperCase(Locale.ROOT));
     log.debug("NodeAddedTrigger {} instantiated with properties: {}", name, properties);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77a5dfe3/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 fba1f3c..5c5a454 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
@@ -85,7 +85,7 @@ public class NodeLostTrigger extends TriggerBase {
     }
     lastLiveNodes = new HashSet<>(container.getZkController().getZkStateReader().getClusterState().getLiveNodes());
     log.debug("Initial livenodes: {}", lastLiveNodes);
-    this.enabled = (boolean) properties.getOrDefault("enabled", true);
+    this.enabled = Boolean.parseBoolean(String.valueOf(properties.getOrDefault("enabled",
"true")));
     this.waitForSecond = ((Long) properties.getOrDefault("waitFor", -1L)).intValue();
     this.eventType = TriggerEventType.valueOf(properties.get("event").toString().toUpperCase(Locale.ROOT));
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/77a5dfe3/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
index 9130b15..fd9ca75 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
@@ -617,7 +617,7 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
 
     Map triggers = (Map) response.get("triggers");
     assertNotNull(triggers);
-    assertEquals(1, triggers.size());
+    assertEquals(2, triggers.size());
     assertTrue(triggers.containsKey("node_added_trigger1"));
     Map node_added_trigger1 = (Map) triggers.get("node_added_trigger1");
     assertEquals(4, node_added_trigger1.size());


Mime
View raw message