Repository: hbase
Updated Branches:
  refs/heads/master 8014c5c3a -> 143ed0d19


HBASE-20258 Shell hangs when scanning a disabled table

Signed-off-by: Mike Drob <md...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/143ed0d1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/143ed0d1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/143ed0d1

Branch: refs/heads/master
Commit: 143ed0d19d189adf1aea1e79123fee56c6c1adb5
Parents: 8014c5c
Author: Balazs Meszaros <balazs.mesza...@cloudera.com>
Authored: Tue Mar 27 15:33:54 2018 +0200
Committer: Mike Drob <md...@apache.org>
Committed: Fri Apr 6 13:43:48 2018 -0700

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/shell/commands.rb   |  3 +++
 hbase-shell/src/test/ruby/hbase/table_test.rb | 11 +++++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/143ed0d1/hbase-shell/src/main/ruby/shell/commands.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/commands.rb 
b/hbase-shell/src/main/ruby/shell/commands.rb
index d7730cf..9fd634c 100644
--- a/hbase-shell/src/main/ruby/shell/commands.rb
+++ b/hbase-shell/src/main/ruby/shell/commands.rb
@@ -116,6 +116,9 @@ module Shell
           raise "Unknown table #{strs[0]}!" if strs.size == 1
           raise "Unknown table #{args.first}!"
         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)
           raise "Unknown region #{args.first}!"
         end

http://git-wip-us.apache.org/repos/asf/hbase/blob/143ed0d1/hbase-shell/src/test/ruby/hbase/table_test.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/hbase/table_test.rb 
b/hbase-shell/src/test/ruby/hbase/table_test.rb
index e7e1b23..c1b288c 100644
--- a/hbase-shell/src/test/ruby/hbase/table_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/table_test.rb
@@ -695,5 +695,16 @@ module Hbase
       assert_equal(0, splits.size)
       assert_equal([], splits)
     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

Reply via email to