lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r927213 - in /lucene/solr/branches/cloud/src: common/org/apache/solr/common/cloud/ java/org/apache/solr/cloud/ java/org/apache/solr/handler/component/ solrj/org/apache/solr/client/solrj/impl/ test/org/apache/solr/cloud/
Date Wed, 24 Mar 2010 22:54:25 GMT
Author: markrmiller
Date: Wed Mar 24 22:54:24 2010
New Revision: 927213

URL: http://svn.apache.org/viewvc?rev=927213&view=rev
Log:
fix CloudServer needing access to ZkController - thanks to Igor Motov

Modified:
    lucene/solr/branches/cloud/src/common/org/apache/solr/common/cloud/ZkStateReader.java
    lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
    lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/QueryComponent.java
    lucene/solr/branches/cloud/src/solrj/org/apache/solr/client/solrj/impl/CloudSolrServer.java
    lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java

Modified: lucene/solr/branches/cloud/src/common/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/common/org/apache/solr/common/cloud/ZkStateReader.java?rev=927213&r1=927212&r2=927213&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/common/org/apache/solr/common/cloud/ZkStateReader.java
(original)
+++ lucene/solr/branches/cloud/src/common/org/apache/solr/common/cloud/ZkStateReader.java
Wed Mar 24 22:54:24 2010
@@ -40,6 +40,8 @@ public class ZkStateReader {
   private static Logger log = LoggerFactory.getLogger(ZkStateReader.class);
   
   public static final String COLLECTIONS_ZKNODE = "/collections";
+  public static final String URL_PROP = "url";
+  public static final String NODE_NAME = "node_name";
   public static final String SHARDS_ZKNODE = "/shards";
   public static final String LIVE_NODES_ZKNODE = "/live_nodes";
   

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java?rev=927213&r1=927212&r2=927213&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java Wed Mar 24
22:54:24 2010
@@ -66,8 +66,6 @@ public final class ZkController {
 
   static final String CONFIGS_ZKNODE = "/configs";
 
-  public static final String URL_PROP = "url";
-  public static final String NODE_NAME = "node_name";
   public final static String COLLECTION_PARAM_PREFIX="collection.";
   public final static String CONFIGNAME_PROP="configName";
 
@@ -449,9 +447,9 @@ public final class ZkController {
     }
 
     ZkNodeProps props = new ZkNodeProps();
-    props.put(URL_PROP, shardUrl);
+    props.put(ZkStateReader.URL_PROP, shardUrl);
     
-    props.put(NODE_NAME, getNodeName());
+    props.put(ZkStateReader.NODE_NAME, getNodeName());
 
     byte[] bytes = props.store();
     

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=927213&r1=927212&r2=927213&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/QueryComponent.java
(original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/QueryComponent.java
Wed Mar 24 22:54:24 2010
@@ -30,6 +30,7 @@ import org.apache.solr.common.SolrExcept
 import org.apache.solr.common.cloud.CloudState;
 import org.apache.solr.common.cloud.Slice;
 import org.apache.solr.common.cloud.ZkNodeProps;
+import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.ShardParams;
@@ -203,7 +204,7 @@ public class QueryComponent extends Sear
             StringBuilder sliceShardsStr = new StringBuilder();
             boolean first = true;
             for (ZkNodeProps nodeProps : sliceShards.values()) {
-              if (!liveNodes.contains(nodeProps.get(ZkController.NODE_NAME)))
+              if (!liveNodes.contains(nodeProps.get(ZkStateReader.NODE_NAME)))
                 continue;
               if (first) {
                 first = false;

Modified: lucene/solr/branches/cloud/src/solrj/org/apache/solr/client/solrj/impl/CloudSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/solrj/org/apache/solr/client/solrj/impl/CloudSolrServer.java?rev=927213&r1=927212&r2=927213&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/solrj/org/apache/solr/client/solrj/impl/CloudSolrServer.java
(original)
+++ lucene/solr/branches/cloud/src/solrj/org/apache/solr/client/solrj/impl/CloudSolrServer.java
Wed Mar 24 22:54:24 2010
@@ -14,7 +14,6 @@ import java.util.concurrent.TimeoutExcep
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.CloudState;
 import org.apache.solr.common.cloud.Slice;
@@ -120,10 +119,10 @@ public class CloudSolrServer extends Sol
     List<String> urlList = new ArrayList<String>();
     for (Slice slice : slices.values()) {
       for (ZkNodeProps nodeProps : slice.getShards().values()) {
-        String node = nodeProps.get(ZkController.NODE_NAME);
+        String node = nodeProps.get(ZkStateReader.NODE_NAME);
         if (!liveNodes.contains(node)) continue;
         if (nodes.put(node, nodeProps) == null) {
-          String url = nodeProps.get(ZkController.URL_PROP);
+          String url = nodeProps.get(ZkStateReader.URL_PROP);
           urlList.add(url);
         }
       }

Modified: lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java?rev=927213&r1=927212&r2=927213&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java (original)
+++ lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java Wed Mar
24 22:54:24 2010
@@ -103,16 +103,16 @@ public class ZkControllerTest extends Te
         assertNotNull(shards.get(SHARD3));
 
         ZkNodeProps props = shards.get(SHARD1);
-        assertEquals(URL1, props.get(ZkController.URL_PROP));
-        assertEquals(TEST_NODE_NAME, props.get(ZkController.NODE_NAME));
+        assertEquals(URL1, props.get(ZkStateReader.URL_PROP));
+        assertEquals(TEST_NODE_NAME, props.get(ZkStateReader.NODE_NAME));
 
         props = shards.get(SHARD2);
-        assertEquals(URL2, props.get(ZkController.URL_PROP));
-        assertEquals(TEST_NODE_NAME, props.get(ZkController.NODE_NAME));
+        assertEquals(URL2, props.get(ZkStateReader.URL_PROP));
+        assertEquals(TEST_NODE_NAME, props.get(ZkStateReader.NODE_NAME));
 
         props = shards.get(SHARD3);
-        assertEquals(URL3, props.get(ZkController.URL_PROP));
-        assertEquals(TEST_NODE_NAME, props.get(ZkController.NODE_NAME));
+        assertEquals(URL3, props.get(ZkStateReader.URL_PROP));
+        assertEquals(TEST_NODE_NAME, props.get(ZkStateReader.NODE_NAME));
 
       }
 
@@ -202,8 +202,8 @@ public class ZkControllerTest extends Te
       KeeperException, InterruptedException {
 
     ZkNodeProps props = new ZkNodeProps();
-    props.put(ZkController.URL_PROP, url);
-    props.put(ZkController.NODE_NAME, TEST_NODE_NAME);
+    props.put(ZkStateReader.URL_PROP, url);
+    props.put(ZkStateReader.NODE_NAME, TEST_NODE_NAME);
     byte[] bytes = props.store();
 
     zkClient



Mime
View raw message