HBASE-23140 Remove unknown table error (#706)
Signed-off-by: huzheng <openinx@gmail.com>
This commit is contained in:
parent
6e3a455887
commit
bb83e423cc
|
@ -30,6 +30,7 @@ java_import org.apache.hadoop.hbase.quotas.QuotaTableUtil
|
|||
java_import org.apache.hadoop.hbase.quotas.SpaceViolationPolicy
|
||||
|
||||
module HBaseQuotasConstants
|
||||
QUOTA_TABLE_NAME = QuotaTableUtil::QUOTA_TABLE_NAME
|
||||
# RPC Quota constants
|
||||
GLOBAL_BYPASS = 'GLOBAL_BYPASS'.freeze
|
||||
THROTTLE_TYPE = 'THROTTLE_TYPE'.freeze
|
||||
|
|
|
@ -33,14 +33,16 @@ EOF
|
|||
|
||||
formatter.header(['DESCRIPTION'], [64])
|
||||
formatter.row([desc], true, [64])
|
||||
|
||||
puts
|
||||
formatter.header(%w[QUOTAS])
|
||||
ns = namespace.to_s
|
||||
count = quotas_admin.list_quotas(NAMESPACE => ns) do |_, quota|
|
||||
formatter.row([quota])
|
||||
if admin.exists?(::HBaseQuotasConstants::QUOTA_TABLE_NAME.to_s)
|
||||
puts formatter.header(%w[QUOTAS])
|
||||
count = quotas_admin.list_quotas(NAMESPACE => ns) do |_, quota|
|
||||
formatter.row([quota])
|
||||
end
|
||||
formatter.footer(count)
|
||||
else
|
||||
puts 'Quota is disabled'
|
||||
end
|
||||
formatter.footer(count)
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
end
|
||||
|
|
|
@ -367,6 +367,17 @@ module Hbase
|
|||
assert(output.include?('0 row(s)'))
|
||||
end
|
||||
|
||||
define_test 'describe_namespace should return quota disabled' do
|
||||
ns = 'ns'
|
||||
quota_table = ::HBaseQuotasConstants::QUOTA_TABLE_NAME.to_s
|
||||
drop_test_table(quota_table)
|
||||
command(:create_namespace, ns)
|
||||
output = capture_stdout { command(:describe_namespace, ns) }
|
||||
# re-creating quota table otherwise other test case may fail
|
||||
command(:create, quota_table, 'q', 'u')
|
||||
assert(output.include?('Quota is disabled'))
|
||||
end
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
define_test 'truncate should empty a table' do
|
||||
|
|
Loading…
Reference in New Issue