[33/50] [abbrv] hbase git commit: HBASE-20287 After cluster startup list_regions command fails on disabled table
HBASE-20287 After cluster startup list_regions command fails on disabled table Add is_enabled check for list_regions command Signed-off-by: Mike Drob Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bdc0d3a4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bdc0d3a4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bdc0d3a4 Branch: refs/heads/HBASE-19064 Commit: bdc0d3a4c612289af8e0472f4ae30b1c39c09c7f Parents: adc0e85 Author: Peter Somogyi Authored: Thu Apr 5 12:12:14 2018 +0200 Committer: Peter Somogyi Committed: Sat Apr 7 18:11:29 2018 +0200 -- .../src/main/ruby/shell/commands/list_regions.rb| 2 ++ hbase-shell/src/test/ruby/hbase/admin_test.rb | 12 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/bdc0d3a4/hbase-shell/src/main/ruby/shell/commands/list_regions.rb -- diff --git a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb index bcc0c4a..0ce569c 100644 --- a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb +++ b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb @@ -50,6 +50,8 @@ EOF options = { SERVER_NAME => options } end +raise "Table #{table_name} must be enabled." unless admin.enabled?(table_name) + size_hash = {} if cols.nil? size_hash = { 'SERVER_NAME' => 12, 'REGION_NAME' => 12, 'START_KEY' => 10, 'END_KEY' => 10, 'SIZE' => 5, 'REQ' => 5, 'LOCALITY' => 10 } http://git-wip-us.apache.org/repos/asf/hbase/blob/bdc0d3a4/hbase-shell/src/test/ruby/hbase/admin_test.rb -- diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb index 929484c..a27bbc5 100644 --- a/hbase-shell/src/test/ruby/hbase/admin_test.rb +++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb @@ -319,6 +319,18 @@ module Hbase admin.truncate_preserve(@create_test_name, $TEST_CLUSTER.getConfiguration) assert_equal(splits, table(@create_test_name)._get_splits_internal()) end + + #--- + +define_test "list_regions should fail for disabled table" do + drop_test_table(@create_test_name) + admin.create(@create_test_name, 'a') + command(:disable, @create_test_name) + assert(:is_disabled, @create_test_name) + assert_raise(RuntimeError) do +command(:list_regions, @create_test_name) + end +end end # Simple administration methods tests
hbase git commit: HBASE-20287 After cluster startup list_regions command fails on disabled table
Repository: hbase Updated Branches: refs/heads/branch-2.0 dd94fe9f1 -> d396e4bc0 HBASE-20287 After cluster startup list_regions command fails on disabled table Add is_enabled check for list_regions command Signed-off-by: Mike Drob Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d396e4bc Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d396e4bc Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d396e4bc Branch: refs/heads/branch-2.0 Commit: d396e4bc075df271edf451bf1a24266f25f9aaf6 Parents: dd94fe9 Author: Peter Somogyi Authored: Thu Apr 5 12:12:14 2018 +0200 Committer: Peter Somogyi Committed: Sat Apr 7 18:12:46 2018 +0200 -- .../src/main/ruby/shell/commands/list_regions.rb| 2 ++ hbase-shell/src/test/ruby/hbase/admin_test.rb | 12 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/d396e4bc/hbase-shell/src/main/ruby/shell/commands/list_regions.rb -- diff --git a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb index bcc0c4a..0ce569c 100644 --- a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb +++ b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb @@ -50,6 +50,8 @@ EOF options = { SERVER_NAME => options } end +raise "Table #{table_name} must be enabled." unless admin.enabled?(table_name) + size_hash = {} if cols.nil? size_hash = { 'SERVER_NAME' => 12, 'REGION_NAME' => 12, 'START_KEY' => 10, 'END_KEY' => 10, 'SIZE' => 5, 'REQ' => 5, 'LOCALITY' => 10 } http://git-wip-us.apache.org/repos/asf/hbase/blob/d396e4bc/hbase-shell/src/test/ruby/hbase/admin_test.rb -- diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb index 929484c..a27bbc5 100644 --- a/hbase-shell/src/test/ruby/hbase/admin_test.rb +++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb @@ -319,6 +319,18 @@ module Hbase admin.truncate_preserve(@create_test_name, $TEST_CLUSTER.getConfiguration) assert_equal(splits, table(@create_test_name)._get_splits_internal()) end + + #--- + +define_test "list_regions should fail for disabled table" do + drop_test_table(@create_test_name) + admin.create(@create_test_name, 'a') + command(:disable, @create_test_name) + assert(:is_disabled, @create_test_name) + assert_raise(RuntimeError) do +command(:list_regions, @create_test_name) + end +end end # Simple administration methods tests
hbase git commit: HBASE-20287 After cluster startup list_regions command fails on disabled table
Repository: hbase Updated Branches: refs/heads/branch-2 dcc1d9e36 -> 2cfa344ab HBASE-20287 After cluster startup list_regions command fails on disabled table Add is_enabled check for list_regions command Signed-off-by: Mike Drob Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2cfa344a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2cfa344a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2cfa344a Branch: refs/heads/branch-2 Commit: 2cfa344ab15f52441c9cf8f48d6f3cdca565a067 Parents: dcc1d9e Author: Peter Somogyi Authored: Thu Apr 5 12:12:14 2018 +0200 Committer: Peter Somogyi Committed: Sat Apr 7 18:12:04 2018 +0200 -- .../src/main/ruby/shell/commands/list_regions.rb| 2 ++ hbase-shell/src/test/ruby/hbase/admin_test.rb | 12 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/2cfa344a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb -- diff --git a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb index bcc0c4a..0ce569c 100644 --- a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb +++ b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb @@ -50,6 +50,8 @@ EOF options = { SERVER_NAME => options } end +raise "Table #{table_name} must be enabled." unless admin.enabled?(table_name) + size_hash = {} if cols.nil? size_hash = { 'SERVER_NAME' => 12, 'REGION_NAME' => 12, 'START_KEY' => 10, 'END_KEY' => 10, 'SIZE' => 5, 'REQ' => 5, 'LOCALITY' => 10 } http://git-wip-us.apache.org/repos/asf/hbase/blob/2cfa344a/hbase-shell/src/test/ruby/hbase/admin_test.rb -- diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb index 929484c..a27bbc5 100644 --- a/hbase-shell/src/test/ruby/hbase/admin_test.rb +++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb @@ -319,6 +319,18 @@ module Hbase admin.truncate_preserve(@create_test_name, $TEST_CLUSTER.getConfiguration) assert_equal(splits, table(@create_test_name)._get_splits_internal()) end + + #--- + +define_test "list_regions should fail for disabled table" do + drop_test_table(@create_test_name) + admin.create(@create_test_name, 'a') + command(:disable, @create_test_name) + assert(:is_disabled, @create_test_name) + assert_raise(RuntimeError) do +command(:list_regions, @create_test_name) + end +end end # Simple administration methods tests
hbase git commit: HBASE-20287 After cluster startup list_regions command fails on disabled table
Repository: hbase Updated Branches: refs/heads/master adc0e85e8 -> bdc0d3a4c HBASE-20287 After cluster startup list_regions command fails on disabled table Add is_enabled check for list_regions command Signed-off-by: Mike Drob Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bdc0d3a4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bdc0d3a4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bdc0d3a4 Branch: refs/heads/master Commit: bdc0d3a4c612289af8e0472f4ae30b1c39c09c7f Parents: adc0e85 Author: Peter Somogyi Authored: Thu Apr 5 12:12:14 2018 +0200 Committer: Peter Somogyi Committed: Sat Apr 7 18:11:29 2018 +0200 -- .../src/main/ruby/shell/commands/list_regions.rb| 2 ++ hbase-shell/src/test/ruby/hbase/admin_test.rb | 12 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/bdc0d3a4/hbase-shell/src/main/ruby/shell/commands/list_regions.rb -- diff --git a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb index bcc0c4a..0ce569c 100644 --- a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb +++ b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb @@ -50,6 +50,8 @@ EOF options = { SERVER_NAME => options } end +raise "Table #{table_name} must be enabled." unless admin.enabled?(table_name) + size_hash = {} if cols.nil? size_hash = { 'SERVER_NAME' => 12, 'REGION_NAME' => 12, 'START_KEY' => 10, 'END_KEY' => 10, 'SIZE' => 5, 'REQ' => 5, 'LOCALITY' => 10 } http://git-wip-us.apache.org/repos/asf/hbase/blob/bdc0d3a4/hbase-shell/src/test/ruby/hbase/admin_test.rb -- diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb index 929484c..a27bbc5 100644 --- a/hbase-shell/src/test/ruby/hbase/admin_test.rb +++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb @@ -319,6 +319,18 @@ module Hbase admin.truncate_preserve(@create_test_name, $TEST_CLUSTER.getConfiguration) assert_equal(splits, table(@create_test_name)._get_splits_internal()) end + + #--- + +define_test "list_regions should fail for disabled table" do + drop_test_table(@create_test_name) + admin.create(@create_test_name, 'a') + command(:disable, @create_test_name) + assert(:is_disabled, @create_test_name) + assert_raise(RuntimeError) do +command(:list_regions, @create_test_name) + end +end end # Simple administration methods tests