hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [01/43] hbase git commit: HBASE-19714 Fix broken status-detailed [Forced Update!]
Date Mon, 08 Jan 2018 07:26:39 GMT
Repository: hbase
Updated Branches:
  refs/heads/HBASE-19397 17e9995d8 -> 42579f474 (forced update)


HBASE-19714 Fix broken status-detailed

Expanded on the unit tests to catch this in the future.

Signed-off-by: Michael Stack <stack@apache.org>


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

Branch: refs/heads/HBASE-19397
Commit: ea819d1733d94cd357177ca1070f5c80b0321d03
Parents: 54928ce
Author: Josh Elser <elserj@apache.org>
Authored: Fri Jan 5 18:13:54 2018 -0500
Committer: Michael Stack <stack@apache.org>
Committed: Sat Jan 6 08:21:51 2018 -0600

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/admin.rb      |  4 +-
 hbase-shell/src/test/ruby/hbase/admin_test.rb | 49 +++++++++++++++++++---
 2 files changed, 45 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ea819d17/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 6e3de37..13b6578 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -727,8 +727,8 @@ module Hbase
       if format == 'detailed'
         puts(format('version %s', status.getHBaseVersion))
         # Put regions in transition first because usually empty
-        puts(format('%d regionsInTransition', status.getRegionsInTransition.size))
-        for v in status.getRegionsInTransition
+        puts(format('%d regionsInTransition', status.getRegionStatesInTransition.size))
+        for v in status.getRegionStatesInTransition
           puts(format('    %s', v))
         end
         master = status.getMaster

http://git-wip-us.apache.org/repos/asf/hbase/blob/ea819d17/hbase-shell/src/test/ruby/hbase/admin_test.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb
index 7318c1a..cbeb8b6 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -515,17 +515,54 @@ module Hbase
       assert_not_equal(nil, table)
       table.close
     end
+  end
+
+  # Tests for the `status` shell command
+  class StatusTest < Test::Unit::TestCase
+    include TestHelpers
+
+    def setup
+      setup_hbase
+      # Create test table if it does not exist
+      @test_name = 'hbase_shell_tests_table'
+      drop_test_table(@test_name)
+      create_test_table(@test_name)
+    end
+
+    def teardown
+      shutdown
+    end
+
+    define_test 'Get replication status' do
+      output = capture_stdout { replication_status('replication', 'both') }
+      puts "Status output:\n#{output}"
+      assert output.include? 'SOURCE'
+      assert output.include? 'SINK'
+    end
+
+    define_test 'Get replication source metrics information' do
+      output = capture_stdout { replication_status('replication', 'source') }
+      puts "Status output:\n#{output}"
+      assert output.include? 'SOURCE'
+    end
 
-    define_test "Get replication status" do
-      replication_status("replication", "both")
+    define_test 'Get replication sink metrics information' do
+      output = capture_stdout { replication_status('replication', 'sink') }
+      puts "Status output:\n#{output}"
+      assert output.include? 'SINK'
     end
 
-    define_test "Get replication source metrics information" do
-      replication_status("replication", "source")
+    define_test 'Get simple status' do
+      output = capture_stdout { admin.status('simple', '') }
+      puts "Status output:\n#{output}"
+      assert output.include? 'active master'
     end
 
-    define_test "Get replication sink metrics information" do
-      replication_status("replication", "sink")
+    define_test 'Get detailed status' do
+      output = capture_stdout { admin.status('detailed', '') }
+      puts "Status output:\n#{output}"
+      # Some text which isn't in the simple output
+      assert output.include? 'regionsInTransition'
     end
   end
 


Mime
View raw message