hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-12885 Unit test for RAW / VERSIONS scanner specifications (Amit Kabra)
Date Mon, 26 Jan 2015 01:32:27 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 5484f7958 -> e3b56ed36


HBASE-12885 Unit test for RAW / VERSIONS scanner specifications (Amit Kabra)


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

Branch: refs/heads/0.98
Commit: e3b56ed36839b98ae3b509ea6eca2d612fcc29cd
Parents: 5484f79
Author: Andrew Purtell <apurtell@apache.org>
Authored: Sun Jan 25 17:22:00 2015 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Sun Jan 25 17:22:36 2015 -0800

----------------------------------------------------------------------
 hbase-shell/src/test/ruby/hbase/table_test.rb | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e3b56ed3/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 fa2990d..d634992 100644
--- a/hbase-shell/src/test/ruby/hbase/table_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/table_test.rb
@@ -478,6 +478,36 @@ module Hbase
       assert_nil(res['2']['x:b'])
     end
 
+    define_test "scan should work with raw and version parameter" do
+      # Create test table if it does not exist
+      @test_name_raw = "hbase_shell_tests_raw_scan"
+      create_test_table(@test_name_raw)
+      @test_table = table(@test_name_raw)
+
+      # Instert test data
+      @test_table.put(1, "x:a", 1)
+      @test_table.put(2, "x:raw1", 11)
+      @test_table.put(2, "x:raw1", 11)
+      @test_table.put(2, "x:raw1", 11)
+      @test_table.put(2, "x:raw1", 11)
+
+      args = {}
+      numRows = 0
+      count = @test_table._scan_internal(args) do |row, cells| # Normal Scan
+        numRows += 1
+      end
+      assert_equal(numRows, 2, "Num rows scanned without RAW/VERSIONS are not 2") 
+
+      args = {VERSIONS=>10,RAW=>true} # Since 4 versions of row with rowkey 2 is been
added, we can use any number >= 4 for VERSIONS to scan all 4 versions.
+      numRows = 0
+      count = @test_table._scan_internal(args) do |row, cells| # Raw Scan
+        numRows += 1
+      end
+      assert_equal(numRows, 5, "Num rows scanned without RAW/VERSIONS are not 5") # 5 since
, 1 from row key '1' and other 4 from row key '4'
+    end
+
+
+
     define_test "scan should fail on invalid COLUMNS parameter types" do
       assert_raise(ArgumentError) do
         @test_table._scan_internal COLUMNS => {}


Mime
View raw message