diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 5eee26c..711cadb 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -500,7 +500,11 @@ module Hbase # Handle the compatibility case, where the truncate method doesn't exists on the Master raise e unless e.respond_to?(:cause) && !e.cause.nil? rootCause = e.cause - if rootCause.is_a?(org.apache.hadoop.hbase.DoNotRetryIOException) + if rootCause.is_a?(org.apache.hadoop.hbase.security.AccessDeniedException) + puts 'Enabling table...' + enable(table_name) + raise e + elsif rootCause.is_a?(org.apache.hadoop.hbase.DoNotRetryIOException) # Handle the compatibility case, where the truncate method doesn't exists on the Master puts 'Dropping table...' @admin.deleteTable(table_name) @@ -543,7 +547,11 @@ module Hbase # Handle the compatibility case, where the truncate method doesn't exists on the Master raise e unless e.respond_to?(:cause) && !e.cause.nil? rootCause = e.cause - if rootCause.is_a?(org.apache.hadoop.hbase.DoNotRetryIOException) + if rootCause.is_a?(org.apache.hadoop.hbase.security.AccessDeniedException) + puts 'Enabling table...' + enable(table_name) + raise e + elsif rootCause.is_a?(org.apache.hadoop.hbase.DoNotRetryIOException) # Handle the compatibility case, where the truncate method doesn't exists on the Master puts 'Dropping table...' @admin.deleteTable(table_name)