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 2011/10/11 18:24:30 UTC

svn commit: r1181874 - /lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullDistributedZkTest.java

Author: markrmiller
Date: Tue Oct 11 16:24:30 2011
New Revision: 1181874

URL: http://svn.apache.org/viewvc?rev=1181874&view=rev
Log:
make it easy to crank up the slices/replicas for this test

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullDistributedZkTest.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullDistributedZkTest.java?rev=1181874&r1=1181873&r2=1181874&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullDistributedZkTest.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/test/org/apache/solr/cloud/FullDistributedZkTest.java Tue Oct 11 16:24:30 2011
@@ -54,6 +54,7 @@ public class FullDistributedZkTest exten
   String oddField="oddField_s";
   String missingField="ignore_exception__missing_but_valid_field_t";
   String invalidField="ignore_exception__invalid_field_not_in_schema";
+  private int sliceCount = 3;
   
   public FullDistributedZkTest() {
     fixShardCount = true;
@@ -97,7 +98,7 @@ public class FullDistributedZkTest exten
     } else {
       // use shard ids rather than physical locations
       StringBuilder sb = new StringBuilder();
-      for (int i = 0; i < shardCount / 2; i++) {
+      for (int i = 0; i < sliceCount ; i++) {
         if (i > 0)
           sb.append(',');
         sb.append("shard" + (i+1));
@@ -113,12 +114,12 @@ public class FullDistributedZkTest exten
  
     boolean pick = random.nextBoolean();
     
-    int mod = (clients.size() / 2);
+    int mod = sliceCount;
     
     int which = (doc.getField(id).toString().hashCode() & 0x7fffffff) % mod;
     
     if (pick) {
-      which = which + mod;
+      which = which + (mod * random.nextInt(sliceCount - 1));
     }
     
     CommonsHttpSolrServer client = (CommonsHttpSolrServer) clients.get(which);