Skip to content

Commit

Permalink
HBASE-25300 'Unknown table hbase:quota' happens when desc table in sh…
Browse files Browse the repository at this point in the history
…ell if quota disabled (apache#2673)

Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Pankaj Kumar<pankajkumar@apache.org>
  • Loading branch information
ddupg authored and infraio committed Nov 19, 2020
1 parent 66a4326 commit 3516cc3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions hbase-shell/src/main/ruby/shell/commands/describe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,19 @@ def command(table)
puts
end
formatter.footer
puts
formatter.header(%w[QUOTAS])
count = quotas_admin.list_quotas(TABLE => table.to_s) do |_, quota|
formatter.row([quota])
if admin.exists?(::HBaseQuotasConstants::QUOTA_TABLE_NAME.to_s)
if table.to_s != 'hbase:meta'
# No QUOTAS if hbase:meta table
puts
formatter.header(%w[QUOTAS])
count = quotas_admin.list_quotas(TABLE => table.to_s) do |_, quota|
formatter.row([quota])
end
formatter.footer(count)
end
else
puts 'Quota is disabled'
end
formatter.footer(count)
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
end
Expand Down

0 comments on commit 3516cc3

Please sign in to comment.