lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1465196 - in /lucene/dev/trunk/solr: CHANGES.txt solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java
Date Sat, 06 Apr 2013 05:58:18 GMT
Author: shalin
Date: Sat Apr  6 05:58:18 2013
New Revision: 1465196

URL: http://svn.apache.org/r1465196
Log:
SOLR-4682: CoreAdminRequest.mergeIndexes can not merge multiple cores or indexDirs

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1465196&r1=1465195&r2=1465196&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Sat Apr  6 05:58:18 2013
@@ -157,6 +157,9 @@ Bug Fixes
 * SOLR-4664: ZkStateReader should update aliases on construction. 
   (Mark Miller, Elodie Sannier)
 
+* SOLR-4682: CoreAdminRequest.mergeIndexes can not merge multiple cores or indexDirs.
+  (Jason.D.Cao via shalin)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java?rev=1465196&r1=1465195&r2=1465196&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
(original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
Sat Apr  6 05:58:18 2013
@@ -349,12 +349,12 @@ public class CoreAdminRequest extends So
       params.set(CoreAdminParams.CORE, core);
       if (indexDirs != null)  {
         for (String indexDir : indexDirs) {
-          params.set(CoreAdminParams.INDEX_DIR, indexDir);
+          params.add(CoreAdminParams.INDEX_DIR, indexDir);
         }
       }
       if (srcCores != null) {
         for (String srcCore : srcCores) {
-          params.set(CoreAdminParams.SRC_CORE, srcCore);
+          params.add(CoreAdminParams.SRC_CORE, srcCore);
         }
       }
       return params;

Modified: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java?rev=1465196&r1=1465195&r2=1465196&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java
(original)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java
Sat Apr  6 05:58:18 2013
@@ -19,6 +19,7 @@ package org.apache.solr.client.solrj;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Arrays;
 
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
@@ -26,6 +27,8 @@ import org.apache.solr.client.solrj.requ
 import org.apache.solr.client.solrj.request.QueryRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.util.ExternalPaths;
@@ -190,4 +193,14 @@ public abstract class MergeIndexesExampl
     assertEquals(1,
         getSolrCore0().query(new SolrQuery("id:BBB")).getResults().size());
   }
+
+  public void testMergeMultipleRequest() throws Exception {
+    CoreAdminRequest.MergeIndexes req = new CoreAdminRequest.MergeIndexes();
+    req.setCoreName("core0");
+    req.setIndexDirs(Arrays.asList("/path/1", "/path/2"));
+    req.setSrcCores(Arrays.asList("core1", "core2"));
+    SolrParams params = req.getParams();
+    assertEquals(2, params.getParams(CoreAdminParams.SRC_CORE).length);
+    assertEquals(2, params.getParams(CoreAdminParams.INDEX_DIR).length);
+  }
 }



Mime
View raw message