HBASE-20258 Shell hangs when scanning a disabled table

Signed-off-by: Mike Drob <mdrob@apache.org>
This commit is contained in:
Balazs Meszaros 2018-03-27 15:33:54 +02:00 committed by Mike Drob
parent 4772a4ebdd
commit a8994afbfe
2 changed files with 14 additions and 0 deletions

View File

@ -114,6 +114,9 @@ module Shell
if cause.is_a?(org.apache.hadoop.hbase.TableNotFoundException) if cause.is_a?(org.apache.hadoop.hbase.TableNotFoundException)
raise "Unknown table #{args.first}!" raise "Unknown table #{args.first}!"
end end
if cause.is_a?(org.apache.hadoop.hbase.TableNotEnabledException)
raise "Table #{args.first} is disabled!"
end
if cause.is_a?(org.apache.hadoop.hbase.UnknownRegionException) if cause.is_a?(org.apache.hadoop.hbase.UnknownRegionException)
raise "Unknown region #{args.first}!" raise "Unknown region #{args.first}!"
end end

View File

@ -695,5 +695,16 @@ module Hbase
assert_equal(0, splits.size) assert_equal(0, splits.size)
assert_equal([], splits) assert_equal([], splits)
end end
define_test "scan should throw an exception on a disabled table" do
@test_table.disable
begin
assert_raise(RuntimeError) do
@test_table.scan
end
ensure
@test_table.enable
end
end
end end
end end