You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by md...@apache.org on 2018/04/06 20:43:41 UTC

[1/2] hbase git commit: HBASE-20258 Shell hangs when scanning a disabled table

Repository: hbase
Updated Branches:
  refs/heads/branch-2 4772a4ebd -> a8994afbf
  refs/heads/branch-2.0 5bf3b33a5 -> bdd87945e


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/a8994afb
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a8994afb
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a8994afb

Branch: refs/heads/branch-2
Commit: a8994afbfeec2c8f33613b3818319591fbe9b9c5
Parents: 4772a4e
Author: Balazs Meszaros <ba...@cloudera.com>
Authored: Tue Mar 27 15:33:54 2018 +0200
Committer: Mike Drob <md...@apache.org>
Committed: Fri Apr 6 11:20:34 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/a8994afb/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 990e978..b4a3407 100644
--- a/hbase-shell/src/main/ruby/shell/commands.rb
+++ b/hbase-shell/src/main/ruby/shell/commands.rb
@@ -114,6 +114,9 @@ module Shell
         if cause.is_a?(org.apache.hadoop.hbase.TableNotFoundException)
           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/a8994afb/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


[2/2] hbase git commit: HBASE-20258 Shell hangs when scanning a disabled table

Posted by md...@apache.org.
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/bdd87945
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bdd87945
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bdd87945

Branch: refs/heads/branch-2.0
Commit: bdd87945e762746bef8d75e65cd176946d70341d
Parents: 5bf3b33
Author: Balazs Meszaros <ba...@cloudera.com>
Authored: Tue Mar 27 15:33:54 2018 +0200
Committer: Mike Drob <md...@apache.org>
Committed: Fri Apr 6 11:20:50 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/bdd87945/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 990e978..b4a3407 100644
--- a/hbase-shell/src/main/ruby/shell/commands.rb
+++ b/hbase-shell/src/main/ruby/shell/commands.rb
@@ -114,6 +114,9 @@ module Shell
         if cause.is_a?(org.apache.hadoop.hbase.TableNotFoundException)
           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/bdd87945/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