lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r903394 - in /lucene/solr/branches/cloud/src/java/org/apache/solr: cloud/SolrZkServer.java core/CoreContainer.java
Date Tue, 26 Jan 2010 20:07:26 GMT
Author: yonik
Date: Tue Jan 26 20:07:25 2010
New Revision: 903394

URL: http://svn.apache.org/viewvc?rev=903394&view=rev
Log:
allow hostPort to be specified as a system property

Modified:
    lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/SolrZkServer.java
    lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/SolrZkServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/SolrZkServer.java?rev=903394&r1=903393&r2=903394&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/SolrZkServer.java (original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/SolrZkServer.java Tue Jan 26
20:07:25 2010
@@ -43,21 +43,20 @@
   String solrPort;
   Properties props;
   SolrZkServerProps zkProps;
-  String zkClientString;
 
   private Thread zkThread;  // the thread running a zookeeper server, only if zkRun is set
 
   public SolrZkServer(String zkRun, String zkHost, String solrHome, String solrPort) {
     this.zkRun = zkRun;
-    this.zkClientString = this.zkHost = zkHost;
+    this.zkHost = zkHost;
     this.solrHome = solrHome;
     this.solrPort = solrPort;
-
-    this.zkClientString = this.zkHost != null ? this.zkHost : this.zkRun;
   }
 
   public String getClientString() {
-    if (props == null) return null;
+    if (zkHost != null) return zkHost;
+    
+    if (zkProps == null) return null;
 
     // if the string wasn't passed as zkHost, then use the standalone server we started
     if (zkRun == null) return null;
@@ -215,7 +214,7 @@
         String host = hostAndPort.substring(0,portIdx);
 
         String serverStr = host + ':' + (clientPort+1);
-        // algorithms other than 0 need an extra port for leader election.
+        // zk leader election algorithms other than 0 need an extra port for leader election.
         if (alg != 0) {
           serverStr = serverStr + ':' + (clientPort+2);
         }

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java?rev=903394&r1=903393&r2=903394&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java Tue Jan 26
20:07:25 2010
@@ -318,7 +318,10 @@
       shareSchema = cfg.getBool("solr/cores/@shareSchema", false);
       zkClientTimeout = cfg.getInt("solr/cores/@zkClientTimeout", 10000);
       if (zkPortOverride == null) {
-        hostPort = cfg.get("solr/cores/@hostPort", "8983");
+        hostPort = System.getProperty("hostPort");
+        if (hostPort == null) {
+          hostPort = cfg.get("solr/cores/@hostPort", "8983");
+        }
       } else {
         hostPort = zkPortOverride;
       }



Mime
View raw message