You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2012/09/15 00:33:25 UTC
svn commit: r1384953 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/core/CoreContainer.java
Author: markrmiller
Date: Fri Sep 14 22:33:25 2012
New Revision: 1384953
URL: http://svn.apache.org/viewvc?rev=1384953&view=rev
Log:
SOLR-3641: CoreContainer is not persisting roles core attribute.
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/CoreContainer.java
Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1384953&r1=1384952&r2=1384953&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Fri Sep 14 22:33:25 2012
@@ -211,6 +211,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/branches/branch_4x/solr/core/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/CoreContainer.java?rev=1384953&r1=1384952&r2=1384953&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/CoreContainer.java Fri Sep 14 22:33: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