You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2019/03/28 12:27:55 UTC

[hbase] branch branch-2.1 updated: HBASE-21781 list_deadservers elapsed time is incorrect

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

psomogyi 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 7896afa  HBASE-21781 list_deadservers elapsed time is incorrect
7896afa is described below

commit 7896afa906cbb47af5652f249f25a531441de5b5
Author: xuqinya <xu...@163.com>
AuthorDate: Thu Mar 28 13:24:49 2019 +0100

    HBASE-21781 list_deadservers elapsed time is incorrect
---
 hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb | 7 ++++++-
 hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb  | 3 ++-
 2 files changed, 8 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 c3b5659..0849e71 100644
--- a/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
@@ -34,7 +34,10 @@ module Shell
         EOF
       end
 
+      # 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'])
@@ -44,9 +47,11 @@ module Shell
           servers.each do |server|
             formatter.row([server.toString])
           end
-          formatter.footer(servers.size)
+          formatter.footer(now, servers.size)
         end
       end
+      # rubocop:enable Metrics/AbcSize
+      # rubocop:enable Metrics/MethodLength
     end
   end
 end
diff --git a/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb b/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb
index be3f0bf..69c7e72 100644
--- a/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb
@@ -29,6 +29,7 @@ module Shell
       end
 
       def command
+        now = Time.now
         formatter.header(['SERVERNAME'])
 
         servers = admin.list_deadservers
@@ -36,7 +37,7 @@ module Shell
           formatter.row([server.toString])
         end
 
-        formatter.footer(servers.size)
+        formatter.footer(now, servers.size)
       end
     end
   end