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 Guanghao Zhang
parent 4d41de1df0
commit 9769e3fe7b

View File

@ -44,14 +44,18 @@ EOF
puts puts
end end
formatter.footer formatter.footer
if table.to_s != 'hbase:meta' if admin.exists?(::HBaseQuotasConstants::QUOTA_TABLE_NAME.to_s)
# No QUOTAS if hbase:meta table if table.to_s != 'hbase:meta'
puts # No QUOTAS if hbase:meta table
formatter.header(%w[QUOTAS]) puts
count = quotas_admin.list_quotas(::HBaseConstants::TABLE => table.to_s) do |_, quota| formatter.header(%w[QUOTAS])
formatter.row([quota]) count = quotas_admin.list_quotas(::HBaseConstants::TABLE => table.to_s) do |_, quota|
formatter.row([quota])
end
formatter.footer(count)
end end
formatter.footer(count) else
puts 'Quota is disabled'
end end
end end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength # rubocop:enable Metrics/AbcSize, Metrics/MethodLength