HBASE-12084 Remove deprecated APIs from Result - shell addendum

This commit is contained in:
anoopsjohn 2014-09-26 10:04:58 +05:30
parent 78d532e5f3
commit 375fc1efe3
3 changed files with 11 additions and 11 deletions

View File

@ -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}")

View File

@ -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)

View File

@ -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)