From 8a8082375e6dd4a2387c8b4c8e9f777eccd5edd6 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Fri, 8 Dec 2017 15:06:37 -0800 Subject: [PATCH] HBASE-19467 rsgroups shell commands don't properly display elapsed time --- hbase-shell/src/main/ruby/shell/commands/get_rsgroup.rb | 3 ++- hbase-shell/src/main/ruby/shell/commands/get_server_rsgroup.rb | 3 ++- hbase-shell/src/main/ruby/shell/commands/get_table_rsgroup.rb | 3 ++- hbase-shell/src/main/ruby/shell/commands/list_rsgroups.rb | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hbase-shell/src/main/ruby/shell/commands/get_rsgroup.rb b/hbase-shell/src/main/ruby/shell/commands/get_rsgroup.rb index ad8a0e328c..46af640bf8 100644 --- a/hbase-shell/src/main/ruby/shell/commands/get_rsgroup.rb +++ b/hbase-shell/src/main/ruby/shell/commands/get_rsgroup.rb @@ -32,11 +32,12 @@ EOF end def command(group_name) + now = Time.now formatter.header(['GROUP INFORMATION']) rsgroup_admin.get_rsgroup(group_name) do |s| formatter.row([s]) end - formatter.footer() + formatter.footer(now, 1) end end end diff --git a/hbase-shell/src/main/ruby/shell/commands/get_server_rsgroup.rb b/hbase-shell/src/main/ruby/shell/commands/get_server_rsgroup.rb index 9884cd18b0..6ebff2ef35 100644 --- a/hbase-shell/src/main/ruby/shell/commands/get_server_rsgroup.rb +++ b/hbase-shell/src/main/ruby/shell/commands/get_server_rsgroup.rb @@ -30,9 +30,10 @@ EOF end def command(server) + now = Time.now group_name = rsgroup_admin.get_rsgroup_of_server(server).getName formatter.row([group_name]) - formatter.footer(1) + formatter.footer(now, 1) end end end diff --git a/hbase-shell/src/main/ruby/shell/commands/get_table_rsgroup.rb b/hbase-shell/src/main/ruby/shell/commands/get_table_rsgroup.rb index 650cda595d..d15cffab1c 100644 --- a/hbase-shell/src/main/ruby/shell/commands/get_table_rsgroup.rb +++ b/hbase-shell/src/main/ruby/shell/commands/get_table_rsgroup.rb @@ -30,10 +30,11 @@ EOF end def command(table) + now = Time.now group_name = rsgroup_admin.get_rsgroup_of_table(table).getName formatter.row([group_name]) - formatter.footer(1) + formatter.footer(now, 1) end end end diff --git a/hbase-shell/src/main/ruby/shell/commands/list_rsgroups.rb b/hbase-shell/src/main/ruby/shell/commands/list_rsgroups.rb index cabe84b37b..6ea1d450de 100644 --- a/hbase-shell/src/main/ruby/shell/commands/list_rsgroups.rb +++ b/hbase-shell/src/main/ruby/shell/commands/list_rsgroups.rb @@ -34,6 +34,7 @@ EOF end def command(regex = '.*') + now = Time.now formatter.header(['GROUPS']) regex = /#{regex}/ unless regex.is_a?(Regexp) @@ -42,7 +43,7 @@ EOF formatter.row([group]) end - formatter.footer(list.size) + formatter.footer(now, list.size) end end end -- 2.13.4