HBASE-1494 HBaseAdmin.getClusterStatus; minor formatting change for shell support

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@779689 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2009-05-28 17:34:51 +00:00
parent 5e1b305116
commit f43fba2216
2 changed files with 16 additions and 3 deletions

View File

@ -271,6 +271,18 @@ module HBase
for server in status.getDeadServerNames()
puts(" %s" % [ server ])
end
elsif format != nil and format == "simple"
puts("%d live servers" % [ status.getServers() ])
for server in status.getServerInfo()
puts(" %s:%d %d" % \
[ server.getServerAddress().getHostname(), \
server.getServerAddress().getPort(), server.getStartCode() ])
puts(" %s" % [ server.getLoad().toString() ])
end
puts("%d dead servers" % [ status.getDeadServers() ])
for server in status.getDeadServerNames()
puts(" %s" % [ server ])
end
else
puts("%d servers, %d dead, %.4f average load" % \
[ status.getServers(), status.getDeadServers(), \

View File

@ -237,11 +237,12 @@ HBASE SHELL COMMANDS:
hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, \\
STARTROW => 'xyz'}
status Show cluster status. Can be 'simple' or 'detailed'. The default is
'simple'. Examples:
status Show cluster status. Can be 'summary', 'simple', or 'detailed'. The
default is 'summary'. Examples:
hbase> status
hbase> status 'simple'
hbase> status 'summary'
hbase> status 'detailed'
shutdown Shut down the cluster.
@ -342,7 +343,7 @@ def close_region(regionName, server = nil)
admin().close_region(regionName, server)
end
def status(format = 'simple')
def status(format = 'summary')
admin().status(format)
end