Repository: hbase Updated Branches: refs/heads/master c30056531 -> 3fbdd5bbe
HBASE-21630 [shell] Define ENDKEY == STOPROW (we have ENDROW) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3fbdd5bb Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3fbdd5bb Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3fbdd5bb Branch: refs/heads/master Commit: 3fbdd5bbe9937bdb12984275dafced9cb6746a63 Parents: c300565 Author: Nihal Jain <nihaljain...@gmail.com> Authored: Wed Jan 2 01:24:08 2019 +0530 Committer: stack <st...@apache.org> Committed: Thu Jan 3 21:58:28 2019 -0800 ---------------------------------------------------------------------- hbase-shell/src/main/ruby/hbase_constants.rb | 2 ++ hbase-shell/src/test/ruby/hbase/table_test.rb | 36 ++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/3fbdd5bb/hbase-shell/src/main/ruby/hbase_constants.rb ---------------------------------------------------------------------- diff --git a/hbase-shell/src/main/ruby/hbase_constants.rb b/hbase-shell/src/main/ruby/hbase_constants.rb index 4c1ad22..9871685 100644 --- a/hbase-shell/src/main/ruby/hbase_constants.rb +++ b/hbase-shell/src/main/ruby/hbase_constants.rb @@ -43,8 +43,10 @@ module HBaseConstants METADATA = org.apache.hadoop.hbase.HConstants::METADATA STOPROW = 'STOPROW'.freeze STARTROW = 'STARTROW'.freeze + STARTKEY = STARTROW ROWPREFIXFILTER = 'ROWPREFIXFILTER'.freeze ENDROW = STOPROW + ENDKEY = STOPROW RAW = 'RAW'.freeze LIMIT = 'LIMIT'.freeze METHOD = 'METHOD'.freeze http://git-wip-us.apache.org/repos/asf/hbase/blob/3fbdd5bb/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 5ec317a..b3343e2 100644 --- a/hbase-shell/src/test/ruby/hbase/table_test.rb +++ b/hbase-shell/src/test/ruby/hbase/table_test.rb @@ -476,6 +476,16 @@ module Hbase assert_not_nil(res['2']['x:b']) end + define_test "scan should support STARTKEY parameter" do + res = @test_table._scan_internal STARTKEY => '2' + assert_not_nil(res) + assert_kind_of(Hash, res) + assert_nil(res['1']) + assert_not_nil(res['2']) + assert_not_nil(res['2']['x:a']) + assert_not_nil(res['2']['x:b']) + end + define_test "scan should support STOPROW parameter" do res = @test_table._scan_internal STOPROW => '2' assert_not_nil(res) @@ -486,7 +496,27 @@ module Hbase assert_nil(res['2']) end - define_test "scan should support ROWPREFIXFILTER parameter (test 1)" do + define_test "scan should support ENDROW parameter" do + res = @test_table._scan_internal ENDROW => '2' + assert_not_nil(res) + assert_kind_of(Hash, res) + assert_not_nil(res['1']) + assert_not_nil(res['1']['x:a']) + assert_not_nil(res['1']['x:b']) + assert_nil(res['2']) + end + + define_test "scan should support ENDKEY parameter" do + res = @test_table._scan_internal ENDKEY => '2' + assert_not_nil(res) + assert_kind_of(Hash, res) + assert_not_nil(res['1']) + assert_not_nil(res['1']['x:a']) + assert_not_nil(res['1']['x:b']) + assert_nil(res['2']) + end + + define_test 'scan should support ROWPREFIXFILTER parameter (test 1)' do res = @test_table._scan_internal ROWPREFIXFILTER => '1' assert_not_nil(res) assert_kind_of(Hash, res) @@ -496,7 +526,7 @@ module Hbase assert_nil(res['2']) end - define_test "scan should support ROWPREFIXFILTER parameter (test 2)" do + define_test 'scan should support ROWPREFIXFILTER parameter (test 2)' do res = @test_table._scan_internal ROWPREFIXFILTER => '2' assert_not_nil(res) assert_kind_of(Hash, res) @@ -506,7 +536,7 @@ module Hbase assert_not_nil(res['2']['x:b']) end - define_test "scan should support LIMIT parameter" do + define_test 'scan should support LIMIT parameter' do res = @test_table._scan_internal LIMIT => 1 assert_not_nil(res) assert_kind_of(Hash, res)