HBASE-23138 Drop_all table by regex fail (#704)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
This commit is contained in:
parent
bb83e423cc
commit
d237106ae6
|
@ -390,15 +390,15 @@ module Hbase
|
|||
def drop_all(regex)
|
||||
pattern = Pattern.compile(regex.to_s)
|
||||
failed = java.util.ArrayList.new
|
||||
admin.listTableNames(pattern).each do |table_name|
|
||||
@admin.listTableNames(pattern).each do |table_name|
|
||||
begin
|
||||
admin.deleteTable(table_name)
|
||||
@admin.deleteTable(table_name)
|
||||
rescue java.io.IOException => e
|
||||
puts puts "table:#{table_name}, error:#{e.toString}"
|
||||
failed.add(table_name)
|
||||
end
|
||||
end
|
||||
@failed
|
||||
failed
|
||||
end
|
||||
|
||||
#----------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -441,6 +441,10 @@ module Hbase
|
|||
admin.enable_all(@regex)
|
||||
assert(command(:is_enabled, @t1))
|
||||
assert(command(:is_enabled, @t2))
|
||||
admin.disable_all(@regex)
|
||||
admin.drop_all(@regex)
|
||||
assert(!command(:exists, @t1))
|
||||
assert(!command(:exists, @t2))
|
||||
end
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue