Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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