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:15 UTC

[hbase] branch branch-2.2 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.2
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit 6283f3026be6059655bf33308b24b664dbdacdae
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 b6c49a5..1cd37ca 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -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