You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2013/05/13 15:24:02 UTC

svn commit: r1481840 [4/4] - in /lucene/dev/branches/lucene4258: ./ dev-tools/ dev-tools/idea/.idea/libraries/ dev-tools/maven/ dev-tools/maven/lucene/replicator/ dev-tools/scripts/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/commo...

Modified: lucene/dev/branches/lucene4258/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java (original)
+++ lucene/dev/branches/lucene4258/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java Mon May 13 13:24:00 2013
@@ -95,7 +95,7 @@ public class SolrIndexSplitterTest exten
       request = lrf.makeRequest("q", "dummy");
 
       SplitIndexCommand command = new SplitIndexCommand(request,
-          Lists.newArrayList(indexDir1.getAbsolutePath(), indexDir2.getAbsolutePath()), null, ranges);
+          Lists.newArrayList(indexDir1.getAbsolutePath(), indexDir2.getAbsolutePath()), null, ranges, new PlainIdRouter());
       new SolrIndexSplitter(command).split();
 
       Directory directory = h.getCore().getDirectoryFactory().get(indexDir1.getAbsolutePath(),
@@ -148,7 +148,7 @@ public class SolrIndexSplitterTest exten
       try {
         request = lrf.makeRequest("q", "dummy");
 
-        SplitIndexCommand command = new SplitIndexCommand(request, null, Lists.newArrayList(core1, core2), ranges);
+        SplitIndexCommand command = new SplitIndexCommand(request, null, Lists.newArrayList(core1, core2), ranges, new PlainIdRouter());
         new SolrIndexSplitter(command).split();
       } finally {
         if (request != null) request.close();
@@ -185,7 +185,7 @@ public class SolrIndexSplitterTest exten
       request = lrf.makeRequest("q", "dummy");
 
       SplitIndexCommand command = new SplitIndexCommand(request,
-          Lists.newArrayList(indexDir1.getAbsolutePath(), indexDir2.getAbsolutePath(), indexDir3.getAbsolutePath()), null, null);
+          Lists.newArrayList(indexDir1.getAbsolutePath(), indexDir2.getAbsolutePath(), indexDir3.getAbsolutePath()), null, null, new PlainIdRouter());
       new SolrIndexSplitter(command).split();
 
       directory = h.getCore().getDirectoryFactory().get(indexDir1.getAbsolutePath(),

Modified: lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.bat
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.bat?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.bat (original)
+++ lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.bat Mon May 13 13:24:00 2013
@@ -8,5 +8,4 @@ REM  Find location of this script
 set SDIR=%~dp0
 if "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%
 
-     
-"%JVM%" -classpath "%SDIR%\..\solr-webapp\webapp\WEB-INF\lib\*;%SDIR%\..\lib\ext" org.apache.solr.cloud.ZkCLI %*
+"%JVM%" -Dlog4j.configuration=file:%SDIR%\log4j.properties -classpath "%SDIR%\..\solr-webapp\webapp\WEB-INF\lib\*;%SDIR%\..\lib\ext\*" org.apache.solr.cloud.ZkCLI %*

Modified: lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.sh
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.sh?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.sh (original)
+++ lucene/dev/branches/lucene4258/solr/example/cloud-scripts/zkcli.sh Mon May 13 13:24:00 2013
@@ -9,6 +9,5 @@ JVM="java"
 
 sdir="`dirname \"$0\"`"
 
-
-$JVM  -classpath "$sdir/../solr-webapp/webapp/WEB-INF/lib/*:$sdir/../lib/ext/*" org.apache.solr.cloud.ZkCLI ${1+"$@"}
+PATH=$JAVA_HOME/bin:$PATH $JVM -Dlog4j.configuration=file:$sdir/log4j.properties -classpath "$sdir/../solr-webapp/webapp/WEB-INF/lib/*:$sdir/../lib/ext/*" org.apache.solr.cloud.ZkCLI ${1+"$@"}
 

Modified: lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml (original)
+++ lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml Mon May 13 13:24:00 2013
@@ -5,22 +5,22 @@
                 pk="link"
                 url="http://rss.slashdot.org/Slashdot/slashdot"
                 processor="XPathEntityProcessor"
-                forEach="/rss/channel | /rss/item"
+                forEach="/rss/channel/item"
                 transformer="DateFormatTransformer">
 				
             <field column="source" xpath="/rss/channel/title" commonField="true" />
             <field column="source-link" xpath="/rss/channel/link" commonField="true" />
             <field column="subject" xpath="/rss/channel/subject" commonField="true" />
 			
-            <field column="title" xpath="/rss/item/title" />
-            <field column="link" xpath="/rss/item/link" />
-            <field column="description" xpath="/rss/item/description" />
-            <field column="creator" xpath="/rss/item/creator" />
-            <field column="item-subject" xpath="/rss/item/subject" />
-            <field column="date" xpath="/rss/item/date" dateTimeFormat="yyyy-MM-dd'T'HH:mm:ss" />
-            <field column="slash-department" xpath="/rss/item/department" />
-            <field column="slash-section" xpath="/rss/item/section" />
-            <field column="slash-comments" xpath="/rss/item/comments" />
+            <field column="title" xpath="/rss/channel/item/title" />
+            <field column="link" xpath="/rss/channel/item/link" />
+            <field column="description" xpath="/rss/channel/item/description" />
+            <field column="creator" xpath="/rss/channel/item/creator" />
+            <field column="item-subject" xpath="/rss/channel/item/subject" />
+            <field column="date" xpath="/rss/channel/item/date" dateTimeFormat="yyyy-MM-dd'T'HH:mm:ss" />
+            <field column="slash-department" xpath="/rss/channel/item/department" />
+            <field column="slash-section" xpath="/rss/channel/item/section" />
+            <field column="slash-comments" xpath="/rss/channel/item/comments" />
         </entity>
     </document>
 </dataConfig>

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java Mon May 13 13:24:00 2013
@@ -36,7 +36,7 @@ public class CompositeIdRouter extends H
   private int separator = '!';
 
   // separator used to optionally specify number of bits to allocate toward first part.
-  private int bitsSepartor = '/';
+  private int bitsSeparator = '/';
   private int bits = 16;
   private int mask1 = 0xffff0000;
   private int mask2 = 0x0000ffff;
@@ -59,7 +59,7 @@ public class CompositeIdRouter extends H
   }
 
   @Override
-  protected int sliceHash(String id, SolrInputDocument doc, SolrParams params) {
+  public int sliceHash(String id, SolrInputDocument doc, SolrParams params) {
     int idx = id.indexOf(separator);
     if (idx < 0) {
       return Hash.murmurhash3_x86_32(id, 0, id.length(), 0);
@@ -69,7 +69,7 @@ public class CompositeIdRouter extends H
     int m2 = mask2;
 
     String part1 = id.substring(0,idx);
-    int commaIdx = part1.indexOf(bitsSepartor);
+    int commaIdx = part1.indexOf(bitsSeparator);
     if (commaIdx > 0) {
       int firstBits = getBits(part1, commaIdx);
       if (firstBits >= 0) {
@@ -105,7 +105,7 @@ public class CompositeIdRouter extends H
     int m2 = mask2;
 
     String part1 = id.substring(0,idx);
-    int bitsSepIdx = part1.indexOf(bitsSepartor);
+    int bitsSepIdx = part1.indexOf(bitsSeparator);
     if (bitsSepIdx > 0) {
       int firstBits = getBits(part1, bitsSepIdx);
       if (firstBits >= 0) {

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java Mon May 13 13:24:00 2013
@@ -42,7 +42,7 @@ public abstract class HashBasedRouter ex
     return range != null && range.includes(hash);
   }
 
-  protected int sliceHash(String id, SolrInputDocument sdoc, SolrParams params) {
+  public int sliceHash(String id, SolrInputDocument sdoc, SolrParams params) {
     return Hash.murmurhash3_x86_32(id, 0, id.length(), 0);
   }
 

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java Mon May 13 13:24:00 2013
@@ -311,13 +311,13 @@ public class SolrZkClient {
   
   public void makePath(String path, File file, boolean failOnExists, boolean retryOnConnLoss)
       throws IOException, KeeperException, InterruptedException {
-    makePath(path, FileUtils.readFileToString(file).getBytes("UTF-8"),
+    makePath(path, FileUtils.readFileToByteArray(file),
         CreateMode.PERSISTENT, null, failOnExists, retryOnConnLoss);
   }
   
   public void makePath(String path, File file, boolean retryOnConnLoss) throws IOException,
       KeeperException, InterruptedException {
-    makePath(path, FileUtils.readFileToString(file).getBytes("UTF-8"), retryOnConnLoss);
+    makePath(path, FileUtils.readFileToByteArray(file), retryOnConnLoss);
   }
   
   public void makePath(String path, CreateMode createMode, boolean retryOnConnLoss) throws KeeperException,

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java Mon May 13 13:24:00 2013
@@ -233,4 +233,27 @@ public abstract class ContentStreamBase 
   public void setSourceInfo(String sourceInfo) {
     this.sourceInfo = sourceInfo;
   }
+  
+  /**
+   * Construct a <code>ContentStream</code> from a <code>File</code>
+   */
+  public static class ByteArrayStream extends ContentStreamBase
+  {
+    private final byte[] bytes;
+    
+    public ByteArrayStream( byte[] bytes, String source ) {
+      this.bytes = bytes; 
+      
+      this.contentType = null;
+      name = source;
+      size = new Long(bytes.length);
+      sourceInfo = source;
+    }
+
+
+    @Override
+    public InputStream getStream() throws IOException {
+      return new ByteArrayInputStream( bytes );
+    }
+  }  
 }

Modified: lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml Mon May 13 13:24:00 2013
@@ -32,8 +32,8 @@
       <dependency org="org.apache.ant" name="ant" rev="1.8.2" transitive="false" />
 
       <dependency org="junit" name="junit" rev="4.10" transitive="false" conf="default->*;junit4-stdalone->*" />
-      <dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.0.9" transitive="false" conf="default->*;junit4-stdalone->*" />
-      <dependency org="com.carrotsearch.randomizedtesting" name="randomizedtesting-runner" rev="2.0.9" transitive="false" conf="default->*;junit4-stdalone->*" />
+      <dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.0.10" transitive="false" conf="default->*;junit4-stdalone->*" />
+      <dependency org="com.carrotsearch.randomizedtesting" name="randomizedtesting-runner" rev="2.0.10" transitive="false" conf="default->*;junit4-stdalone->*" />
 
       <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/> 
     </dependencies>

Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java?rev=1481840&r1=1481839&r2=1481840&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java Mon May 13 13:24:00 2013
@@ -183,8 +183,8 @@ public class TestHarness extends BaseTes
         String solrHome = SolrResourceLoader.locateSolrHome();
         container = new CoreContainer(new SolrResourceLoader(solrHome)) {
           {
-            String hostPort = System.getProperty("hostPort");
-            String hostContext = "solr";
+            String hostPort = System.getProperty("hostPort", "8983");
+            String hostContext = System.getProperty("hostContext", "solr");
             defaultCoreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
             initShardHandler();
             zkSys.initZooKeeper(this, solrHome, System.getProperty("zkHost"), 30000, hostPort, hostContext, null, "30000", 30000, 30000);