You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by gx...@apache.org on 2019/11/26 11:32:14 UTC

[hbase] branch branch-2.1 updated: HBASE-23336 [CLI] Incorrect row(s) count 'clear_deadservers' (#875)

This is an automated email from the ASF dual-hosted git repository.

gxcheng pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 1b52831  HBASE-23336 [CLI] Incorrect row(s) count 'clear_deadservers' (#875)
1b52831 is described below

commit 1b528315a221e6da9a55cc2a3a272dccbf41c586
Author: Karthik Palanisamy <kp...@hortonworks.com>
AuthorDate: Tue Nov 26 03:20:33 2019 -0800

    HBASE-23336 [CLI] Incorrect row(s) count 'clear_deadservers' (#875)
    
    Signed-off-by: Guangxu Cheng <gx...@apache.org>
    Signed-off-by: Lijin Bin <bi...@apache.org>
---
 hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb | 3 +--
 hbase-shell/src/test/ruby/hbase/admin_test.rb                 | 5 +++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb b/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
index 0849e71..d1f9059 100644
--- a/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
@@ -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
diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb
index 9bcd2e7..9ade5f6 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -106,6 +106,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