Skip to content

Commit

Permalink
HBASE-23336 [CLI] Incorrect row(s) count 'clear_deadservers' (apache#875
Browse files Browse the repository at this point in the history
)

Signed-off-by: Guangxu Cheng <gxcheng@apache.org>
Signed-off-by: Lijin Bin <binlijin@apache.org>
  • Loading branch information
Karthik Palanisamy authored and guangxuCheng committed Nov 26, 2019
1 parent 483617d commit 6283f30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def help
# 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'])
Expand All @@ -47,7 +46,7 @@ def command(*dead_servers)
servers.each do |server|
formatter.row([server.toString])
end
formatter.footer(now, servers.size)
formatter.footer(servers.size)
end
end
# rubocop:enable Metrics/AbcSize
Expand Down
5 changes: 5 additions & 0 deletions hbase-shell/src/test/ruby/hbase/admin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def teardown
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
Expand Down

0 comments on commit 6283f30

Please sign in to comment.