use qt param

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1294862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-02-28 22:25:29 +00:00
parent 9ab8f9b83c
commit 7a8db2fcff
1 changed files with 7 additions and 4 deletions

View File

@ -777,8 +777,9 @@ public class CoreAdminHandler extends RequestHandlerBase {
final ZkNodeProps node = shardEntry.getValue(); final ZkNodeProps node = shardEntry.getValue();
if (cloudState.liveNodesContain(node.get(ZkStateReader.NODE_NAME_PROP))) { if (cloudState.liveNodesContain(node.get(ZkStateReader.NODE_NAME_PROP))) {
newParams.set(CoreAdminParams.CORE, node.get(ZkStateReader.CORE_NAME_PROP)); newParams.set(CoreAdminParams.CORE, node.get(ZkStateReader.CORE_NAME_PROP));
String replica = node.get(ZkStateReader.BASE_URL_PROP) + "/admin/cores"; String replica = node.get(ZkStateReader.BASE_URL_PROP);
ShardRequest sreq = new ShardRequest(); ShardRequest sreq = new ShardRequest();
newParams.set("qt", "/admin/cores");
sreq.purpose = 1; sreq.purpose = 1;
// TODO: this sucks // TODO: this sucks
if (replica.startsWith("http://")) if (replica.startsWith("http://"))
@ -795,9 +796,11 @@ public class CoreAdminHandler extends RequestHandlerBase {
ShardResponse srsp; ShardResponse srsp;
do { do {
srsp = shardHandler.takeCompletedOrError(); srsp = shardHandler.takeCompletedOrError();
Throwable e = srsp.getException(); if (srsp != null) {
if (e != null) { Throwable e = srsp.getException();
log.error("Error talking to shard: " + srsp.getShard(), e); if (e != null) {
log.error("Error talking to shard: " + srsp.getShard(), e);
}
} }
} while(srsp != null); } while(srsp != null);