This is an automated email from the ASF dual-hosted git repository.

openinx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new e254f5e  HBASE-22425 Balance shell command broken in HBase-3.0.0
e254f5e is described below

commit e254f5e67fa0878404a2bcc4c0fcd25caf671f95
Author: huzheng <[email protected]>
AuthorDate: Wed May 15 20:58:54 2019 +0800

    HBASE-22425 Balance shell command broken in HBase-3.0.0
---
 hbase-shell/src/main/ruby/hbase/admin.rb      |  2 +-
 hbase-shell/src/test/ruby/hbase/admin_test.rb | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb 
b/hbase-shell/src/main/ruby/hbase/admin.rb
index a9f69b5..4187a0e 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -189,7 +189,7 @@ module Hbase
     # Requests a cluster balance
     # Returns true if balancer ran
     def balancer(force)
-      @admin.balancer(java.lang.Boolean.valueOf(force))
+      @admin.balance(java.lang.Boolean.valueOf(force))
     end
 
     
#----------------------------------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb 
b/hbase-shell/src/test/ruby/hbase/admin_test.rb
index 65d2eef..41b0616 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -164,6 +164,18 @@ module Hbase
 
     
#-------------------------------------------------------------------------------
 
+    define_test "balance should work" do
+      command(:balance_switch, true)
+      output = capture_stdout { command(:balancer_enabled) }
+      assert(output.include?('true'))
+
+      command(:balancer)
+      output = capture_stdout { command(:balancer, 'force') }
+      assert(output.include?('true'))
+    end
+
+    
#-------------------------------------------------------------------------------
+
     define_test "create should fail with non-string table names" do
       assert_raise(ArgumentError) do
         command(:create, 123, 'xxx')

Reply via email to