HBASE-22425 Balance shell command broken in HBase-3.0.0

This commit is contained in:
huzheng 2019-05-15 20:58:54 +08:00
parent 759ee217c5
commit e254f5e67f
2 changed files with 13 additions and 1 deletions

View File

@ -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
#----------------------------------------------------------------------------------------------

View File

@ -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')