hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [1/4] hbase git commit: HBASE-14805 status should show the master in shell
Date Wed, 18 Nov 2015 23:51:59 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 474c39913 -> 5fe779a61
  refs/heads/branch-1 a6e0ad636 -> 98f7dcc38
  refs/heads/branch-1.2 8a00b4bc8 -> ac92762d3
  refs/heads/master d738aade2 -> b2c20cebb


HBASE-14805 status should show the master in shell


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/b2c20ceb
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b2c20ceb
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b2c20ceb

Branch: refs/heads/master
Commit: b2c20cebb013060f3e81ad22b38841e865a5ba9a
Parents: d738aad
Author: Enis Soztutar <enis@apache.org>
Authored: Wed Nov 18 15:25:48 2015 -0800
Committer: Enis Soztutar <enis@apache.org>
Committed: Wed Nov 18 15:25:48 2015 -0800

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/admin.rb | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b2c20ceb/hbase-shell/src/main/ruby/hbase/admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb
index 03703bc..ac201cd 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -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
 


Mime
View raw message