Repository: hbase
Updated Branches:
  refs/heads/branch-2 90b9ed152 -> 97219f1ac


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

Branch: refs/heads/branch-2
Commit: 97219f1aceed4c48c77e28b1d1fbf36814e59539
Parents: 90b9ed1
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:59:18 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/97219f1a/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 1a2c732..9cfe0c1 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/97219f1a/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)

Reply via email to