lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1095128 - in /lucene/dev/branches/branch_3x: ./ lucene/ solr/ solr/CHANGES.txt solr/src/java/org/apache/solr/core/CoreContainer.java solr/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
Date Tue, 19 Apr 2011 16:26:01 GMT
Author: markrmiller
Date: Tue Apr 19 16:26:01 2011
New Revision: 1095128

URL: http://svn.apache.org/viewvc?rev=1095128&view=rev
Log:
SOLR-2333: The "rename" core admin action does not persist the new name to solr.xml

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/CHANGES.txt
    lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/CoreContainer.java
    lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java

Modified: lucene/dev/branches/branch_3x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/CHANGES.txt?rev=1095128&r1=1095127&r2=1095128&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/solr/CHANGES.txt Tue Apr 19 16:26:01 2011
@@ -73,7 +73,8 @@ Bug Fixes
   performance/algorithmic improvements when (facet.sort=count && facet.mincount=1
   && facet.limit=-1) and when (facet.sort=index && facet.mincount>0) 
(yonik)
 
-
+* SOLR-2333: The "rename" core admin action does not persist the new name to solr.xml
+  (Rasmus Hahn, Paul R. Brown via Mark Miller)
 
 Other Changes
 ----------------------

Modified: lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/CoreContainer.java?rev=1095128&r1=1095127&r2=1095128&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/core/CoreContainer.java Tue
Apr 19 16:26:01 2011
@@ -381,7 +381,12 @@ public class CoreContainer 
     SolrCore old = null;
     synchronized (cores) {
       old = cores.put(name, core);
+      /*
+      * set both the name of the descriptor and the name of the
+      * core, since the descriptors name is used for persisting.
+      */
       core.setName(name);
+      core.getCoreDescriptor().name = name;
     }
 
 

Modified: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java?rev=1095128&r1=1095127&r2=1095128&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
(original)
+++ lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
Tue Apr 19 16:26:01 2011
@@ -110,6 +110,10 @@ public class TestSolrProperties extends 
   protected SolrServer getSolrAdmin() {
     return new EmbeddedSolrServer(cores, "core0");
   }
+  
+  protected SolrServer getRenamedSolrAdmin() {
+    return new EmbeddedSolrServer(cores, "renamed_core");
+  }
 
   protected SolrServer getSolrCore(String name) {
     return new EmbeddedSolrServer(cores, name);
@@ -197,7 +201,17 @@ public class TestSolrProperties extends 
     } finally {
       fis.close();
     }
- 
+    
+    CoreAdminRequest.renameCore(name, "renamed_core", coreadmin);
+    mcr = CoreAdminRequest.persist("solr-persist.xml", getRenamedSolrAdmin());
+    
+    fis = new FileInputStream(new File(solrXml.getParent(), "solr-persist.xml"));
+    try {
+      Document document = builder.parse(fis);
+      assertTrue(exists("/solr/cores/core[@name='renamed_core']", document));
+    } finally {
+      fis.close();
+    }
   }
   
   public static boolean exists(String xpathStr, Node node)



Mime
View raw message