SOLR-5609 , removing accidental changes

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1571421 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2014-02-24 20:09:37 +00:00
parent fab92b83d0
commit b7290ceab4
1 changed files with 10 additions and 23 deletions

View File

@ -336,9 +336,7 @@ public class OverseerCollectionProcessor implements Runnable, ClosableThread {
}
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 implements Runnable, ClosableThread {
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 implements Runnable, ClosableThread {
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 implements Runnable, ClosableThread {
}
// 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 implements Runnable, ClosableThread {
}
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 implements Runnable, ClosableThread {
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 implements Runnable, ClosableThread {
// 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 implements Runnable, ClosableThread {
// 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;