lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject lucene-solr:feature/autoscaling: precicion has to be a positive value
Date Fri, 26 May 2017 05:38:39 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/feature/autoscaling f4c186c9c -> c3aa3f9fa


precicion has to be a positive value


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

Branch: refs/heads/feature/autoscaling
Commit: c3aa3f9fa67fe3adcf5e60b0e5c758dc0b3146c0
Parents: f4c186c
Author: Noble Paul <noble@apache.org>
Authored: Fri May 26 15:08:31 2017 +0930
Committer: Noble Paul <noble@apache.org>
Committed: Fri May 26 15:08:31 2017 +0930

----------------------------------------------------------------------
 .../src/java/org/apache/solr/cloud/autoscaling/Preference.java    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c3aa3f9f/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Preference.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Preference.java b/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Preference.java
index 972a5bc..ff9730b 100644
--- a/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Preference.java
+++ b/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Preference.java
@@ -38,6 +38,9 @@ class Preference implements MapWriter {
     name = Policy.SortParam.get(m.get(sort.name()).toString());
     Object p = m.getOrDefault("precision", 0);
     precision = p instanceof Number ? ((Number) p).intValue() : Integer.parseInt(p.toString());
+    if (precision < 0) {
+      throw new RuntimeException("precision must be a positive value ");
+    }
 
   }
 


Mime
View raw message