You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2013/04/23 20:50:10 UTC

svn commit: r1471092 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java

Author: markrmiller
Date: Tue Apr 23 18:50:10 2013
New Revision: 1471092

URL: http://svn.apache.org/r1471092
Log:
SOLR-4752: There are some minor bugs in the Collections API parameter validation.

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1471092&r1=1471091&r2=1471092&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Tue Apr 23 18:50:10 2013
@@ -54,6 +54,9 @@ Bug Fixes
   not also a dynamic field triggers error message 'undefined field: "(glob)"'.
   (Adam Hahn, hossman, Steve Rowe)
 
+* SOLR-4752: There are some minor bugs in the Collections API parameter
+  validation. (Mark Miller)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java?rev=1471092&r1=1471091&r2=1471092&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java Tue Apr 23 18:50:10 2013
@@ -592,7 +592,7 @@ public class OverseerCollectionProcessor
       Integer numSlices = msgStrToInt(message, NUM_SLICES, null);
       
       if (numSlices == null) {
-        throw new SolrException(ErrorCode.BAD_REQUEST, "collection already exists: " + collectionName);
+        throw new SolrException(ErrorCode.BAD_REQUEST, NUM_SLICES + " is a required param");
       }
       
       int maxShardsPerNode = msgStrToInt(message, MAX_SHARDS_PER_NODE, 1);
@@ -600,7 +600,7 @@ public class OverseerCollectionProcessor
       List<String> createNodeList = ((createNodeSetStr = message.getStr(CREATE_NODE_SET)) == null)?null:StrUtils.splitSmart(createNodeSetStr, ",", true);
       
       if (repFactor <= 0) {
-        throw new SolrException(ErrorCode.BAD_REQUEST, NUM_SLICES + " is a required paramater");
+        throw new SolrException(ErrorCode.BAD_REQUEST, REPLICATION_FACTOR + " must be greater than or equal to 0");
       }
       
       if (numSlices <= 0) {
@@ -781,7 +781,7 @@ public class OverseerCollectionProcessor
     }
   }
   
-  private int msgStrToInt(ZkNodeProps message, String key, Integer def)
+  private Integer msgStrToInt(ZkNodeProps message, String key, Integer def)
       throws Exception {
     String str = message.getStr(key);
     try {