HBASE-19467 rsgroups shell commands don't properly display elapsed time
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4698cf16 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4698cf16 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4698cf16 Branch: refs/heads/branch-1 Commit: 4698cf16ed0c66ea185dab89ebbbf33151883a7c Parents: bae3b0b Author: Andrew Purtell <[email protected]> Authored: Fri Dec 8 15:06:37 2017 -0800 Committer: Andrew Purtell <[email protected]> Committed: Fri Dec 8 15:13:31 2017 -0800 ---------------------------------------------------------------------- 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(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/4698cf16/hbase-shell/src/main/ruby/shell/commands/get_rsgroup.rb ---------------------------------------------------------------------- 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 ad8a0e3..46af640 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 http://git-wip-us.apache.org/repos/asf/hbase/blob/4698cf16/hbase-shell/src/main/ruby/shell/commands/get_server_rsgroup.rb ---------------------------------------------------------------------- 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 9884cd1..6ebff2e 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 http://git-wip-us.apache.org/repos/asf/hbase/blob/4698cf16/hbase-shell/src/main/ruby/shell/commands/get_table_rsgroup.rb ---------------------------------------------------------------------- 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 650cda5..d15cffa 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 http://git-wip-us.apache.org/repos/asf/hbase/blob/4698cf16/hbase-shell/src/main/ruby/shell/commands/list_rsgroups.rb ---------------------------------------------------------------------- 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 cabe84b..6ea1d45 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
