HBASE-25300 'Unknown table hbase:quota' happens when desc table in shell if quota disabled (#2673)

Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Pankaj Kumar<pankajkumar@apache.org>
This commit is contained in:
XinSun 2020-11-19 09:16:25 +08:00 committed by GitHub
parent 9419c78d26
commit 2b61b99668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -44,14 +44,18 @@ EOF
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