You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2010/02/09 22:13:13 UTC

svn commit: r908224 - /lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java

Author: yonik
Date: Tue Feb  9 21:13:13 2010
New Revision: 908224

URL: http://svn.apache.org/viewvc?rev=908224&view=rev
Log:
also test distrib search with shards retrieved from cloud state

Modified:
    lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java

Modified: lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java?rev=908224&r1=908223&r2=908224&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java (original)
+++ lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java Tue Feb  9 21:13:13 2010
@@ -66,18 +66,19 @@
   protected void setDistributedParams(ModifiableSolrParams params) {
     // super.setDistributedParams(params);
 
-    // TODO: this doesn't work yet because of the extra shards in the collection from
-    // localhost:8983 and control_shardId
-    // params.set("distrib","true");
-
-    // use shard ids rather than physical locations
-    StringBuilder sb = new StringBuilder();
-    for (int i=0; i<nServers; i++) {
-      if (i>0) sb.append(',');
-      sb.append("shardId"+(i+3));
+    if (r.nextBoolean()) {
+      // don't set shards, let that be figured out from the cloud state
+      params.set("distrib","true");
+    } else {
+      // use shard ids rather than physical locations
+      StringBuilder sb = new StringBuilder();
+      for (int i=0; i<nServers; i++) {
+        if (i>0) sb.append(',');
+        sb.append("shardId"+(i+3));
+      }
+      params.set("shards",sb.toString());
+      params.set("distrib","true");
     }
-    params.set("shards",sb.toString());
-    params.set("distrib","true");
   }
 
   // TODO: there is an incorrect localhost:8983 shard registered