hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1096523 - in /hbase/trunk: CHANGES.txt src/main/ruby/hbase/table.rb src/test/ruby/hbase/table_test.rb
Date Mon, 25 Apr 2011 17:09:05 GMT
Author: stack
Date: Mon Apr 25 17:09:05 2011
New Revision: 1096523

URL: http://svn.apache.org/viewvc?rev=1096523&view=rev
Log:
HBASE-2470 Add Scan.setTimeRange() support in Shell

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/ruby/hbase/table.rb
    hbase/trunk/src/test/ruby/hbase/table_test.rb

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1096523&r1=1096522&r2=1096523&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Mon Apr 25 17:09:05 2011
@@ -183,6 +183,7 @@ Release 0.91.0 - Unreleased
    HBASE-3609  Improve the selection of regions to balance; part 2 (Ted Yu)
    HBASE-2939  Allow Client-Side Connection Pooling (Karthik Sankarachary)
    HBASE-3798  [REST] Allow representation to elide row key and column key
+   HBASE-2470  Add Scan.setTimeRange() support in Shell (Harsh J Chouraria)
 
   TASKS
    HBASE-3559  Move report of split to master OFF the heartbeat channel

Modified: hbase/trunk/src/main/ruby/hbase/table.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/ruby/hbase/table.rb?rev=1096523&r1=1096522&r2=1096523&view=diff
==============================================================================
--- hbase/trunk/src/main/ruby/hbase/table.rb (original)
+++ hbase/trunk/src/main/ruby/hbase/table.rb Mon Apr 25 17:09:05 2011
@@ -221,6 +221,7 @@ module Hbase
         columns = args["COLUMNS"] || args["COLUMN"] || get_all_columns
         cache = args["CACHE_BLOCKS"] || true
         versions = args["VERSIONS"] || 1
+        timerange = args[TIMERANGE]
 
         # Normalize column names
         columns = [columns] if columns.class == String
@@ -239,6 +240,7 @@ module Hbase
         scan.setTimeStamp(timestamp) if timestamp
         scan.setCacheBlocks(cache)
         scan.setMaxVersions(versions) if versions > 1
+        scan.setTimeRange(timerange[0], timerange[1]) if timerange
       else
         scan = org.apache.hadoop.hbase.client.Scan.new
       end

Modified: hbase/trunk/src/test/ruby/hbase/table_test.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/ruby/hbase/table_test.rb?rev=1096523&r1=1096522&r2=1096523&view=diff
==============================================================================
--- hbase/trunk/src/test/ruby/hbase/table_test.rb (original)
+++ hbase/trunk/src/test/ruby/hbase/table_test.rb Mon Apr 25 17:09:05 2011
@@ -369,6 +369,14 @@ module Hbase
       assert_not_nil(res['2']['x:b'])
     end
 
+    define_test "scan should support TIMERANGE parameter" do
+      res = @test_table.scan TIMERANGE => [0, 1]
+      assert_not_nil(res)
+      assert_kind_of(Hash, res)
+      assert_nil(res['1'])
+      assert_nil(res['2'])
+    end
+
     define_test "scan should support COLUMNS parameter with an array of columns" do
       res = @test_table.scan COLUMNS => [ 'x:a', 'x:b' ]
       assert_not_nil(res)



Mime
View raw message