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:
parent
779e69fe1f
commit
1049de29b1
|
@ -37,7 +37,6 @@ module Shell
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
def command(*dead_servers)
|
def command(*dead_servers)
|
||||||
now = Time.now
|
|
||||||
servers = admin.clear_deadservers(dead_servers)
|
servers = admin.clear_deadservers(dead_servers)
|
||||||
if servers.size <= 0
|
if servers.size <= 0
|
||||||
formatter.row(['true'])
|
formatter.row(['true'])
|
||||||
|
@ -47,7 +46,7 @@ module Shell
|
||||||
servers.each do |server|
|
servers.each do |server|
|
||||||
formatter.row([server.toString])
|
formatter.row([server.toString])
|
||||||
end
|
end
|
||||||
formatter.footer(now, servers.size)
|
formatter.footer(servers.size)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
|
|
|
@ -103,6 +103,11 @@ module Hbase
|
||||||
assert(output.include?('0 row(s)'))
|
assert(output.include?('0 row(s)'))
|
||||||
end
|
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
|
define_test "flush should work" do
|
||||||
|
|
Loading…
Reference in New Issue