lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1384952 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/core/CoreContainer.java
Date Fri, 14 Sep 2012 22:31:25 GMT
Author: markrmiller
Date: Fri Sep 14 22:31:25 2012
New Revision: 1384952

URL: http://svn.apache.org/viewvc?rev=1384952&view=rev
Log:
SOLR-3641: CoreContainer is not persisting roles core attribute. 

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1384952&r1=1384951&r2=1384952&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Fri Sep 14 22:31:25 2012
@@ -215,6 +215,9 @@ Bug Fixes
 * SOLR-3813: When a new leader syncs, we need to ask all shards to sync back, 
   not just those that are active. (Mark Miller)
 
+* SOLR-3641: CoreContainer is not persisting roles core attribute. 
+  (hossman, Mark Miller)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java?rev=1384952&r1=1384951&r2=1384952&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/CoreContainer.java Fri Sep 14
22:31:25 2012
@@ -92,6 +92,7 @@ import org.xml.sax.SAXException;
  */
 public class CoreContainer 
 {
+  private static final String LEADER_VOTE_WAIT = "180000";  // 3 minutes
   private static final String DEFAULT_HOST_CONTEXT = "solr";
   private static final String DEFAULT_HOST_PORT = "8983";
   private static final int DEFAULT_ZK_CLIENT_TIMEOUT = 15000;
@@ -461,7 +462,7 @@ public class CoreContainer 
     hostContext = cfg.get("solr/cores/@hostContext", DEFAULT_HOST_CONTEXT);
     host = cfg.get("solr/cores/@host", null);
     
-    leaderVoteWait = cfg.get("solr/cores/@leaderVoteWait", "180000"); // 3 minutes
+    leaderVoteWait = cfg.get("solr/cores/@leaderVoteWait", LEADER_VOTE_WAIT);
 
     if(shareSchema){
       indexSchemaCache = new ConcurrentHashMap<String ,IndexSchema>();
@@ -1246,6 +1247,7 @@ public class CoreContainer 
         intToString(this.zkClientTimeout),
         Integer.toString(DEFAULT_ZK_CLIENT_TIMEOUT));
     addCoresAttrib(coresAttribs, "hostContext", this.hostContext, DEFAULT_HOST_CONTEXT);
+    addCoresAttrib(coresAttribs, "leaderVoteWait", this.leaderVoteWait, LEADER_VOTE_WAIT);
     
     List<SolrCoreXMLDef> solrCoreXMLDefs = new ArrayList<SolrCoreXMLDef>();
     
@@ -1318,11 +1320,15 @@ public class CoreContainer 
         
         CloudDescriptor cd = dcore.getCloudDescriptor();
         String shard = null;
+        String roles = null;
         if (cd != null) {
           shard = cd.getShardId();
+          roles = cd.getRoles();
         }
         addCoreProperty(coreAttribs, coreNode, CORE_SHARD, shard, null);
         
+        addCoreProperty(coreAttribs, coreNode, CORE_ROLES, roles, null);
+        
         String collection = null;
         // only write out the collection name if it's not the default (the
         // core



Mime
View raw message