You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2019/06/03 07:46:44 UTC

[lucene-solr] branch jira/SOLR-13329 updated: SOLR-13504: In autoscaling policies, use an explicit 'put : on-each' to specify the the rules is applied on each node

This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch jira/SOLR-13329
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/jira/SOLR-13329 by this push:
     new dc1c8dc  SOLR-13504: In autoscaling policies, use an explicit 'put : on-each' to specify the the rules is applied on each node
dc1c8dc is described below

commit dc1c8dcff319a7baa01863f40fcacfb9ba671103
Author: noble <no...@apache.org>
AuthorDate: Mon Jun 3 17:46:25 2019 +1000

    SOLR-13504: In autoscaling policies, use an explicit 'put : on-each' to specify the the rules is applied on each node
---
 solr/CHANGES.txt                                                      | 3 +++
 .../java/org/apache/solr/client/solrj/cloud/autoscaling/Clause.java   | 4 ++--
 .../org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java    | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 59497e1..2e82aa6 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -102,6 +102,9 @@ New Features
 * SOLR-13504: In autoscaling policies, use an explicit 'nodeset' attribute for filtering
   nodes instead of using them directly at the toplevel (noble)
 
+* SOLR-13504: In autoscaling policies, use an explicit 'put : on-each'
+  to specify the the rules is applied on each node  (noble)
+
 Bug Fixes
 ----------------------
 
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Clause.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Clause.java
index ee7ae31..adfbfcb 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Clause.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Clause.java
@@ -106,7 +106,7 @@ public class Clause implements MapWriter, Comparable<Clause> {
     this.hashCode = original.hashCode();
     String type = (String) m.get("type");
     this.type = type == null || ANY.equals(type) ? null : Replica.Type.valueOf(type.toUpperCase(Locale.ROOT));
-    String put = (String) m.getOrDefault("put", m.containsKey(NODESET)? Put.ON_ANY.val: null );
+    String put = (String) m.getOrDefault("put", m.containsKey(NODESET)? Put.ON_ALL.val: null );
     if (put != null) {
       this.put = Put.get(put);
       if (this.put == null) throwExp(m, "invalid value for put : {0}", put);
@@ -751,7 +751,7 @@ public class Clause implements MapWriter, Comparable<Clause> {
   public static final String METRICS_PREFIX = "metrics:";
 
   enum Put {
-    ON_ANY_EQUALLY("equally-on-any"), ON_ANY("on-any"), ON_EACH("on-each");
+    ON_ALL("on-all"), ON_EACH("on-each");
 
     public final String val;
 
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java b/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
index e1d63b5..d085faf 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
@@ -713,7 +713,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
         () -> Clause.create("{replica:1, nodeset : {sysprop.zone : east  , port: 8983 }}"));
     assertTrue(exp.getMessage().contains("nodeset must only have one and only one key"));
     clause = Clause.create("{'replica': '#ALL', 'nodeset': {'freedisk': '>700'}, 'strict': false}");
-    assertEquals(clause.put, Clause.Put.ON_ANY);
+    assertEquals(clause.put, Clause.Put.ON_ALL);
     assertEquals(Operand.GREATER_THAN , clause.tag.op);
     clause = Clause.create("{'replica': '#ALL', put: on-each,  'nodeset': {sysprop.zone : east}}");
     assertEquals(clause.put, Clause.Put.ON_EACH);