HBASE-23336 [CLI] Incorrect row(s) count 'clear_deadservers' (#875)

Signed-off-by: Guangxu Cheng <gxcheng@apache.org>
Signed-off-by: Lijin Bin <binlijin@apache.org>
This commit is contained in:
Karthik Palanisamy 2019-11-26 03:20:33 -08:00 committed by Guangxu Cheng
parent 779e69fe1f
commit 1049de29b1
2 changed files with 6 additions and 2 deletions

View File

@ -37,7 +37,6 @@ module Shell
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def command(*dead_servers)
now = Time.now
servers = admin.clear_deadservers(dead_servers)
if servers.size <= 0
formatter.row(['true'])
@ -47,7 +46,7 @@ module Shell
servers.each do |server|
formatter.row([server.toString])
end
formatter.footer(now, servers.size)
formatter.footer(servers.size)
end
end
# rubocop:enable Metrics/AbcSize

View File

@ -103,6 +103,11 @@ module Hbase
assert(output.include?('0 row(s)'))
end
define_test 'clear_deadservers should show exact row(s) count' do
output = capture_stdout { command(:clear_deadservers, 'test.server.com,16020,1574583397867') }
assert(output.include?('1 row(s)'))
end
#-------------------------------------------------------------------------------
define_test "flush should work" do