HBASE-14805 status should show the master in shell

This commit is contained in:
Enis Soztutar 2015-11-18 15:25:48 -08:00
parent d738aade2e
commit b2c20cebb0
1 changed files with 16 additions and 1 deletions

View File

@ -673,6 +673,14 @@ module Hbase
for k, v in status.getRegionsInTransition()
puts(" %s" % [v])
end
master = status.getMaster()
puts("active master: %s:%d %d" % [master.getHostname(), master.getPort(), master.getStartcode()])
puts("%d backup masters" % [ status.getBackupMastersSize() ])
for server in status.getBackupMasters()
puts(" %s:%d %d" % \
[ server.getHostname(), server.getPort(), server.getStartcode() ])
end
master_coprocs = java.util.Arrays.toString(@admin.getMasterCoprocessors())
if master_coprocs != nil
puts("master coprocessors: %s" % master_coprocs)
@ -734,6 +742,13 @@ module Hbase
elsif format == "simple"
load = 0
regions = 0
master = status.getMaster()
puts("active master: %s:%d %d" % [master.getHostname(), master.getPort(), master.getStartcode()])
puts("%d backup masters" % [ status.getBackupMastersSize() ])
for server in status.getBackupMasters()
puts(" %s:%d %d" % \
[ server.getHostname(), server.getPort(), server.getStartcode() ])
end
puts("%d live servers" % [ status.getServersSize() ])
for server in status.getServers()
puts(" %s:%d %d" % \
@ -748,7 +763,7 @@ module Hbase
end
puts("Aggregate load: %d, regions: %d" % [ load , regions ] )
else
puts "#{status.getServersSize} servers, #{status.getDeadServers} dead, #{'%.4f' % status.getAverageLoad} average load"
puts "1 active master, #{status.getBackupMastersSize} backup masters, #{status.getServersSize} servers, #{status.getDeadServers} dead, #{'%.4f' % status.getAverageLoad} average load"
end
end