lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1424768 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/icu/src/java/org/apache/lucene/collation/ lucene/backwards/ lucene/benchmark/ lucene/codecs/ lucene/core/ lucene/core/src/test/org/apache/l...
Date Thu, 20 Dec 2012 23:59:29 GMT
Author: hossman
Date: Thu Dec 20 23:59:28 2012
New Revision: 1424768

URL: http://svn.apache.org/viewvc?rev=1424768&view=rev
Log:
SOLR-4136: revert unclean r1424762

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/BUILD.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/JRE_VERSION_MIGRATION.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/MIGRATE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/README.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/icu/src/java/org/apache/lucene/collation/ICUCollationKeyFilterFactory.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_4x/lucene/benchmark/   (props changed)
    lucene/dev/branches/branch_4x/lucene/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/codecs/   (props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.cfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.nocfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.cfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.nocfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/demo/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/grouping/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
    lucene/dev/branches/branch_4x/lucene/ivy-settings.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/join/   (props changed)
    lucene/dev/branches/branch_4x/lucene/licenses/   (props changed)
    lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/module-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/   (props changed)
    lucene/dev/branches/branch_4x/lucene/queryparser/   (props changed)
    lucene/dev/branches/branch_4x/lucene/sandbox/   (props changed)
    lucene/dev/branches/branch_4x/lucene/site/   (props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
    lucene/dev/branches/branch_4x/lucene/suggest/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ZkController.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
    lucene/dev/branches/branch_4x/solr/site/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/testlogging.properties   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)

Modified: lucene/dev/branches/branch_4x/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/build.xml?rev=1424768&r1=1424767&r2=1424768&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/build.xml Thu Dec 20 23:59:28 2012
@@ -282,8 +282,6 @@
   
   <!-- Clean targets -->
   <target name="clean" description="Cleans compiled files and other temporary artifacts.">
-    <!-- need to fix up the perms before we try to delete -->
-    <force-test-file-perms build.dir="build" perms="u+w" />
     <delete dir="build" />
     <delete dir="dist" />
     <delete dir="package" />

Modified: lucene/dev/branches/branch_4x/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/common-build.xml?rev=1424768&r1=1424767&r2=1424768&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/common-build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/common-build.xml Thu Dec 20 23:59:28 2012
@@ -109,19 +109,6 @@
  
   <path id="test.classpath" refid="solr.test.base.classpath"/>
 
-  <macrodef name="force-test-file-perms">
-    <attribute name="build.dir" />
-    <attribute name="perms" />
-    <sequential>
-      <chmod perm="@{perms}" type="both">
-        <fileset dir="@{build.dir}" erroronmissingdir="false">
-          <include name="**/test-files" />
-          <include name="**/test-files/**" />
-        </fileset>
-      </chmod> 
-    </sequential>
-  </macrodef>
-
   <macrodef name="solr-contrib-uptodate">
     <attribute name="name"/>
     <attribute name="property" default="@{name}.uptodate"/>
@@ -394,8 +381,6 @@
     <sync todir="${build.dir}/test-files">
       <fileset dir="${tests.userdir}"/>
     </sync>
-    <!-- don't let tests muck with this -->
-    <force-test-file-perms build.dir="${build.dir}" perms="ugo-w" />
   </target>
 
   <!-- Solr test-framework targets -->
@@ -448,14 +433,6 @@
     <contrib-crawl target="add-to-war"/>
   </target>
   
-  <target name="clean" 
-          description="Removes contents of build and dist directories"
-          depends="-make-test-files-writable, common.clean" />
-  <target name="-make-test-files-writable">
-    <force-test-file-perms build.dir="${build.dir}" perms="u+w" />
-  </target> 
-  
-
   <!-- hack for now to disable *all* Solr tests on Jenkins when "tests.disable-solr" property
is set -->
   <target name="test" unless="tests.disable-solr">
     <antcall target="common.test" inheritrefs="true" inheritall="true"/>

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1424768&r1=1424767&r2=1424768&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ZkController.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ZkController.java
Thu Dec 20 23:59:28 2012
@@ -142,12 +142,17 @@ public final class ZkController {
       TimeoutException, IOException {
     if (cc == null) throw new IllegalArgumentException("CoreContainer cannot be null.");
     this.cc = cc;
-
-    // be forgiving and strip this off leading/trailing slashes
-    // this allows us to support users specifying hostContext="/" in 
-    // solr.xml to indicate the root context, instead of hostContext="" 
-    // which means the default of "solr"
-    localHostContext = trimLeadingAndTrailingSlashes(localHostContext);
+    if (localHostContext.startsWith("/")) {
+      // be forgiving and strip this off
+      // this allows us to support users specifying hostContext="/" in 
+      // solr.xml to indicate the root context, instead of hostContext="" 
+      // which means the default of "solr"
+      localHostContext = localHostContext.substring(1);
+    }
+    if (localHostContext.endsWith("/")) {
+      // be extra nice
+      localHostContext = localHostContext.substring(0,localHostContext.length()-1);
+    }
     
     updateShardHandler = new UpdateShardHandler(distribUpdateConnTimeout, distribUpdateSoTimeout);
     
@@ -1308,9 +1313,9 @@ public final class ZkController {
   /**
    * Returns the nodeName that should be used based on the specified properties.
    *
-   * @param hostName - must not be null or the empty string
-   * @param hostPort - must consist only of digits, must not be null or the empty string
-   * @param hostContext - should not begin or end with a slash (leading/trailin slashes will
be ignored), must not be null, may be the empty string to denote the root context
+   * @param hostName - must not be the empty string
+   * @param hostPort - must consist only of digits, must not be the empty string
+   * @param hostContext - should not begin or end with a slash, may be the empty string to
denote the root context
    * @lucene.experimental
    * @see SolrZkClient#getBaseUrlForNodeName
    */
@@ -1319,27 +1324,9 @@ public final class ZkController {
                                  final String hostContext) {
     try {
       return hostName + ':' + hostPort + '_' + 
-        URLEncoder.encode(trimLeadingAndTrailingSlashes(hostContext), "UTF-8");
+        URLEncoder.encode(hostContext, "UTF-8");
     } catch (UnsupportedEncodingException e) {
       throw new IllegalStateException("JVM Does not seem to support UTF-8", e);
     }
   }
-  
-  /**
-   * utilitiy method fro trimming and leading and/or trailing slashes from 
-   * it's input.  May return the empty string.  May return null if and only 
-   * if the input is null.
-   */
-  private static String trimLeadingAndTrailingSlashes(final String in) {
-    if (null == in) return in;
-    
-    String out = in;
-    if (out.startsWith("/")) {
-      out = out.substring(1);
-    }
-    if (out.endsWith("/")) {
-      out = out.substring(0,out.length()-1);
-    }
-    return out;
-  }
 }

Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java?rev=1424768&r1=1424767&r2=1424768&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java
Thu Dec 20 23:59:28 2012
@@ -53,22 +53,10 @@ public class ZkControllerTest extends So
     // nodeName from parts
     assertEquals("localhost:8888_solr",
                  ZkController.generateNodeName("localhost", "8888", "solr"));
-    assertEquals("localhost:8888_solr",
-                 ZkController.generateNodeName("localhost", "8888", "/solr"));
-    assertEquals("localhost:8888_solr",
-                 ZkController.generateNodeName("localhost", "8888", "/solr/"));
-    // root context
-    assertEquals("localhost:8888_", 
+    assertEquals("localhost:8888_", // root context
                  ZkController.generateNodeName("localhost", "8888", ""));
-    assertEquals("localhost:8888_", 
-                 ZkController.generateNodeName("localhost", "8888", "/"));
-    // subdir
     assertEquals("foo-bar:77_solr%2Fsub_dir",
                  ZkController.generateNodeName("foo-bar", "77", "solr/sub_dir"));
-    assertEquals("foo-bar:77_solr%2Fsub_dir",
-                 ZkController.generateNodeName("foo-bar", "77", "/solr/sub_dir"));
-    assertEquals("foo-bar:77_solr%2Fsub_dir",
-                 ZkController.generateNodeName("foo-bar", "77", "/solr/sub_dir/"));
 
     // setup a SolrZkClient to do some getBaseUrlForNodeName testing
     String zkDir = dataDir.getAbsolutePath() + File.separator
@@ -87,41 +75,27 @@ public class ZkControllerTest extends So
         // getBaseUrlForNodeName
         assertEquals("http://zzz.xxx:1234/solr",
                      zkClient.getBaseUrlForNodeName("zzz.xxx:1234_solr"));
-        assertEquals("http://xxx:99",
+        assertEquals("http://xxx:99/",
                      zkClient.getBaseUrlForNodeName("xxx:99_"));
         assertEquals("http://foo-bar.baz.org:9999/some_dir",
                      zkClient.getBaseUrlForNodeName("foo-bar.baz.org:9999_some_dir"));
         assertEquals("http://foo-bar.baz.org:9999/solr/sub_dir",
                      zkClient.getBaseUrlForNodeName("foo-bar.baz.org:9999_solr%2Fsub_dir"));
         
+        
         // generateNodeName + getBaseUrlForNodeName
         assertEquals("http://foo:9876/solr",
                      zkClient.getBaseUrlForNodeName
                      (ZkController.generateNodeName("foo","9876","solr")));
-        assertEquals("http://foo:9876/solr",
-                     zkClient.getBaseUrlForNodeName
-                     (ZkController.generateNodeName("foo","9876","/solr")));
-        assertEquals("http://foo:9876/solr",
-                     zkClient.getBaseUrlForNodeName
-                     (ZkController.generateNodeName("foo","9876","/solr/")));
         assertEquals("http://foo.bar.com:9876/solr/sub_dir",
                      zkClient.getBaseUrlForNodeName
                      (ZkController.generateNodeName("foo.bar.com","9876","solr/sub_dir")));
-        assertEquals("http://foo.bar.com:9876/solr/sub_dir",
-                     zkClient.getBaseUrlForNodeName
-                     (ZkController.generateNodeName("foo.bar.com","9876","/solr/sub_dir/")));
-        assertEquals("http://foo-bar:9876",
+        assertEquals("http://foo-bar:9876/",
                      zkClient.getBaseUrlForNodeName
                      (ZkController.generateNodeName("foo-bar","9876","")));
-        assertEquals("http://foo-bar:9876",
-                     zkClient.getBaseUrlForNodeName
-                     (ZkController.generateNodeName("foo-bar","9876","/")));
         assertEquals("http://foo-bar.com:80/some_dir",
                      zkClient.getBaseUrlForNodeName
                      (ZkController.generateNodeName("foo-bar.com","80","some_dir")));
-        assertEquals("http://foo-bar.com:80/some_dir",
-                     zkClient.getBaseUrlForNodeName
-                     (ZkController.generateNodeName("foo-bar.com","80","/some_dir")));
       } finally {
         zkClient.close();
       }

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java?rev=1424768&r1=1424767&r2=1424768&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
(original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
Thu Dec 20 23:59:28 2012
@@ -484,7 +484,7 @@ public class SolrZkClient {
     try {
       final String path = URLDecoder.decode(nodeName.substring(1+_offset),
                                             "UTF-8");
-      return "http://" + hostAndPort + (path.isEmpty() ? "" : ("/" + path));
+      return "http://" + hostAndPort + "/" + path;
     } catch (UnsupportedEncodingException e) {
       throw new IllegalStateException("JVM Does not seem to support UTF-8", e);
     }



Mime
View raw message