From 375fc1efe3f542243e18a581ea0daee1d27d5d87 Mon Sep 17 00:00:00 2001 From: anoopsjohn Date: Fri, 26 Sep 2014 10:04:58 +0530 Subject: [PATCH] HBASE-12084 Remove deprecated APIs from Result - shell addendum --- hbase-shell/src/main/ruby/hbase/table.rb | 18 +++++++++--------- .../src/main/ruby/shell/commands/grant.rb | 2 +- .../main/ruby/shell/commands/set_visibility.rb | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hbase-shell/src/main/ruby/hbase/table.rb b/hbase-shell/src/main/ruby/hbase/table.rb index cc4f2a7cba2..da0295bff30 100644 --- a/hbase-shell/src/main/ruby/hbase/table.rb +++ b/hbase-shell/src/main/ruby/hbase/table.rb @@ -355,12 +355,12 @@ EOF # Print out results. Result can be Cell or RowResult. res = {} - result.list.each do |kv| - family = String.from_java_bytes(kv.getFamily) - qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getQualifier) + result.listCells.each do |c| + family = String.from_java_bytes(c.getFamily) + qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(c.getQualifier) column = "#{family}:#{qualifier}" - value = to_string(column, kv, maxlength) + value = to_string(column, c, maxlength) if block_given? yield(column, value) @@ -387,7 +387,7 @@ EOF return nil if result.isEmpty # Fetch cell value - cell = result.list[0] + cell = result.listCells[0] org.apache.hadoop.hbase.util.Bytes::toLong(cell.getValue) end @@ -481,12 +481,12 @@ EOF row = iter.next key = org.apache.hadoop.hbase.util.Bytes::toStringBinary(row.getRow) - row.list.each do |kv| - family = String.from_java_bytes(kv.getFamily) - qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getQualifier) + row.listCells.each do |c| + family = String.from_java_bytes(c.getFamily) + qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(c.getQualifier) column = "#{family}:#{qualifier}" - cell = to_string(column, kv, maxlength) + cell = to_string(column, c, maxlength) if block_given? yield(key, "column=#{column}, #{cell}") diff --git a/hbase-shell/src/main/ruby/shell/commands/grant.rb b/hbase-shell/src/main/ruby/shell/commands/grant.rb index 89fdde68b96..43fb720a0f3 100644 --- a/hbase-shell/src/main/ruby/shell/commands/grant.rb +++ b/hbase-shell/src/main/ruby/shell/commands/grant.rb @@ -92,7 +92,7 @@ EOF iter = scanner.iterator while iter.hasNext row = iter.next - row.list.each do |cell| + row.listCells.each do |cell| put = org.apache.hadoop.hbase.client.Put.new(row.getRow) put.add(cell) t.set_cell_permissions(put, permissions) diff --git a/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb b/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb index b2b57b19c35..cdb7724f7e6 100644 --- a/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb +++ b/hbase-shell/src/main/ruby/shell/commands/set_visibility.rb @@ -57,7 +57,7 @@ EOF iter = scanner.iterator while iter.hasNext row = iter.next - row.list.each do |cell| + row.listCells.each do |cell| put = org.apache.hadoop.hbase.client.Put.new(row.getRow) put.add(cell) t.set_cell_visibility(put, visibility)