### Eclipse Workspace Patch 1.0 #P apache-trunk Index: hbase-shell/src/main/ruby/hbase.rb =================================================================== --- hbase-shell/src/main/ruby/hbase.rb (revision 1549735) +++ hbase-shell/src/main/ruby/hbase.rb (working copy) @@ -48,6 +48,7 @@ METHOD = "METHOD" MAXLENGTH = "MAXLENGTH" CACHE_BLOCKS = "CACHE_BLOCKS" + REVERSED = "REVERSED" REPLICATION_SCOPE = "REPLICATION_SCOPE" INTERVAL = 'INTERVAL' CACHE = 'CACHE' Index: hbase-shell/src/main/ruby/shell/commands/scan.rb =================================================================== --- hbase-shell/src/main/ruby/shell/commands/scan.rb (revision 1549735) +++ hbase-shell/src/main/ruby/shell/commands/scan.rb (working copy) @@ -42,6 +42,7 @@ hbase> scan 'hbase:meta', {COLUMNS => 'info:regioninfo'} hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, STARTROW => 'xyz'} hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, 1303668904]} + hbase> scan 't1', {REVERSED => true} hbase> scan 't1', {FILTER => "(PrefixFilter ('row2') AND (QualifierFilter (>=, 'binary:xyz'))) AND (TimestampsFilter ( 123, 456))"} hbase> scan 't1', {FILTER => Index: hbase-shell/src/main/ruby/hbase/table.rb =================================================================== --- hbase-shell/src/main/ruby/hbase/table.rb (revision 1549735) +++ hbase-shell/src/main/ruby/hbase/table.rb (working copy) @@ -346,6 +346,7 @@ columns = args["COLUMNS"] || args["COLUMN"] || [] cache_blocks = args["CACHE_BLOCKS"] || true cache = args["CACHE"] || 0 + reversed = args["REVERSED"] || false versions = args["VERSIONS"] || 1 timerange = args[TIMERANGE] raw = args["RAW"] || false @@ -380,6 +381,7 @@ scan.setTimeStamp(timestamp) if timestamp scan.setCacheBlocks(cache_blocks) + scan.setReversed(reversed) scan.setCaching(cache) if cache > 0 scan.setMaxVersions(versions) if versions > 1 scan.setTimeRange(timerange[0], timerange[1]) if timerange Index: hbase-shell/src/test/ruby/hbase/table_test.rb =================================================================== --- hbase-shell/src/test/ruby/hbase/table_test.rb (revision 1549735) +++ hbase-shell/src/test/ruby/hbase/table_test.rb (working copy) @@ -424,6 +424,18 @@ assert_not_nil(res['1']['x:b']) assert_nil(res['2']) end + + define_test "scan should support REVERSED parameter" do + res = @test_table._scan_internal REVERSED => true + 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_not_nil(res['2']) + assert_not_nil(res['2']['x:a']) + assert_not_nil(res['2']['x:b']) + end define_test "scan should support TIMESTAMP parameter" do res = @test_table._scan_internal TIMESTAMP => @test_ts