You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2014/02/24 21:09:38 UTC
svn commit: r1571421 -
/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
Author: noble
Date: Mon Feb 24 20:09:37 2014
New Revision: 1571421
URL: http://svn.apache.org/r1571421
Log:
SOLR-5609 , removing accidental changes
Modified:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java?rev=1571421&r1=1571420&r2=1571421&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java Mon Feb 24 20:09:37 2014
@@ -336,9 +336,7 @@ public class OverseerCollectionProcessor
}
Map m = (Map) ZkStateReader.fromJSON(data);
String s = (String) m.get("id");
-// log.info("leader-id {}",s);
String nodeName = LeaderElector.getNodeName(s);
-// log.info("Leader {}", nodeName);
return nodeName;
}
@@ -431,20 +429,6 @@ public class OverseerCollectionProcessor
return new OverseerSolrResponse(results);
}
- /* private void handleProp(ZkNodeProps message, NamedList results) throws KeeperException, InterruptedException {
- String name = message.getStr("name");
- String val = message.getStr("val");
- Map m = zkStateReader.getClusterProps();
- if(val ==null) m.remove(name);
- else m.put(name,val);
- if(zkStateReader.getZkClient().exists(ZkStateReader.CLUSTER_PROPS,true))
- zkStateReader.getZkClient().setData(ZkStateReader.CLUSTER_PROPS,ZkStateReader.toJSON(m),true);
- else
- zkStateReader.getZkClient().create(ZkStateReader.CLUSTER_PROPS, ZkStateReader.toJSON(m),CreateMode.PERSISTENT, true);
-
-
-
- }*/
private void processRoleCommand(ZkNodeProps message, String operation) throws KeeperException, InterruptedException {
SolrZkClient zkClient = zkStateReader.getZkClient();
Map roles = null;
@@ -515,7 +499,6 @@ public class OverseerCollectionProcessor
ShardRequest sreq = new ShardRequest();
sreq.purpose = 1;
- if (baseUrl.startsWith("http://")) baseUrl = baseUrl.substring(7);
sreq.shards = new String[] {baseUrl};
sreq.actualShards = sreq.shards;
sreq.params = new ModifiableSolrParams(new MapSolrParams(m));
@@ -834,7 +817,13 @@ public class OverseerCollectionProcessor
}
// find the leader for the shard
- Replica parentShardLeader = clusterState.getLeader(collectionName, slice);
+ Replica parentShardLeader = null;
+ try {
+ parentShardLeader = zkStateReader.getLeaderRetry(collectionName, slice, 10000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+
DocRouter.Range range = parentSlice.getRange();
if (range == null) {
range = new PlainIdRouter().fullRange();
@@ -1357,7 +1346,7 @@ public class OverseerCollectionProcessor
}
log.info("Common hash range between source shard: {} and target shard: {} = " + splitRange, sourceSlice.getName(), targetSlice.getName());
- Replica targetLeader = targetSlice.getLeader();
+ Replica targetLeader = zkStateReader.getLeaderRetry(targetCollection.getName(), targetSlice.getName(), 10000);
log.info("Asking target leader node: " + targetLeader.getNodeName() + " core: "
+ targetLeader.getStr("core") + " to buffer updates");
@@ -1401,7 +1390,7 @@ public class OverseerCollectionProcessor
log.info("Routing rule added successfully");
// Create temp core on source shard
- Replica sourceLeader = sourceSlice.getLeader();
+ Replica sourceLeader = zkStateReader.getLeaderRetry(sourceCollection.getName(), sourceSlice.getName(), 10000);
// create a temporary collection with just one node on the shard leader
String configName = zkStateReader.readConfigName(sourceCollection.getName());
@@ -1417,7 +1406,7 @@ public class OverseerCollectionProcessor
// refresh cluster state
clusterState = zkStateReader.getClusterState();
Slice tempSourceSlice = clusterState.getCollection(tempSourceCollectionName).getSlices().iterator().next();
- Replica tempSourceLeader = zkStateReader.getLeaderRetry(tempSourceCollectionName, tempSourceSlice.getName(), 60000);
+ Replica tempSourceLeader = zkStateReader.getLeaderRetry(tempSourceCollectionName, tempSourceSlice.getName(), 120000);
String tempCollectionReplica1 = tempSourceCollectionName + "_" + tempSourceSlice.getName() + "_replica1";
String coreNodeName = waitForCoreNodeName(clusterState.getCollection(tempSourceCollectionName),
@@ -1866,8 +1855,6 @@ public class OverseerCollectionProcessor
// yes, they must use same admin handler path everywhere...
cloneParams.set("qt", adminPath);
sreq.purpose = 1;
- // TODO: this sucks
- if (replica.startsWith("http://")) replica = replica.substring(7);
sreq.shards = new String[] {replica};
sreq.actualShards = sreq.shards;
sreq.params = cloneParams;