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 (#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 4d41de1 commit 9769e3f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions hbase-shell/src/main/ruby/shell/commands/describe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ def command(table)
puts
end
formatter.footer
if table.to_s != 'hbase:meta'
# No QUOTAS if hbase:meta table
puts
formatter.header(%w[QUOTAS])
count = quotas_admin.list_quotas(::HBaseConstants::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(::HBaseConstants::TABLE => table.to_s) do |_, quota|
formatter.row([quota])
end
formatter.footer(count)
end
formatter.footer(count)
else
puts 'Quota is disabled'
end
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
Expand Down

0 comments on commit 9769e3f

Please sign in to comment.