HBASE-3277 HBase Shell zk_dump command broken

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1038870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-11-24 23:28:56 +00:00
parent 0bbfd1a364
commit b54fed1e4d
3 changed files with 13 additions and 13 deletions

View File

@ -712,6 +712,7 @@ Release 0.90.0 - Unreleased
is now async by default
HBASE-3275 [rest] No gzip/deflate content encoding support
HBASE-3261 NPE out of HRS.run at startup when clock is out of sync
HBASE-3277 HBase Shell zk_dump command broken
IMPROVEMENTS

View File

@ -1027,33 +1027,32 @@ public class ZKUtil {
public static String dump(ZooKeeperWatcher zkw) {
StringBuilder sb = new StringBuilder();
try {
sb.append("\nHBase tree in ZooKeeper is rooted at ").append(zkw.baseZNode);
sb.append("\n Cluster up? ").append(checkExists(zkw, zkw.clusterStateZNode));
sb.append("\n Master address: ").append(
sb.append("HBase is rooted at ").append(zkw.baseZNode);
sb.append("\nMaster address: ").append(
getDataAsAddress(zkw, zkw.masterAddressZNode));
sb.append("\n Region server holding ROOT: ").append(
sb.append("\nRegion server holding ROOT: ").append(
getDataAsAddress(zkw, zkw.rootServerZNode));
sb.append("\n Region servers:");
sb.append("\nRegion servers:");
for (HServerAddress address : listChildrenAndGetAsAddresses(zkw,
zkw.rsZNode)) {
sb.append("\n - ").append(address);
sb.append("\n ").append(address);
}
sb.append("\n Quorum Server Statistics:");
sb.append("\nQuorum Server Statistics:");
String[] servers = zkw.getQuorum().split(",");
for (String server : servers) {
sb.append("\n - ").append(server);
sb.append("\n ").append(server);
try {
String[] stat = getServerStats(server);
for (String s : stat) {
sb.append("\n ").append(s);
sb.append("\n ").append(s);
}
} catch (Exception e) {
sb.append("\n ERROR: ").append(e.getMessage());
sb.append("\n ERROR: ").append(e.getMessage());
}
}
} catch(KeeperException ke) {
sb.append("\n FATAL ZooKeeper Exception!\n");
sb.append("\n " + ke.getMessage());
sb.append("\nFATAL ZooKeeper Exception!\n");
sb.append("\n" + ke.getMessage());
}
return sb.toString();
}

View File

@ -106,7 +106,7 @@ module Hbase
#----------------------------------------------------------------------------------------------
# Returns ZooKeeper status dump
def zk_dump
@zk_wrapper.dump
org.apache.hadoop.hbase.zookeeper.ZKUtil::dump(@zk_wrapper)
end
#----------------------------------------------------------------------------------------------