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. # Print out results. Result can be Cell or RowResult.
res = {} res = {}
result.list.each do |kv| result.listCells.each do |c|
family = String.from_java_bytes(kv.getFamily) family = String.from_java_bytes(c.getFamily)
qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getQualifier) qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(c.getQualifier)
column = "#{family}:#{qualifier}" column = "#{family}:#{qualifier}"
value = to_string(column, kv, maxlength) value = to_string(column, c, maxlength)
if block_given? if block_given?
yield(column, value) yield(column, value)
@ -387,7 +387,7 @@ EOF
return nil if result.isEmpty return nil if result.isEmpty
# Fetch cell value # Fetch cell value
cell = result.list[0] cell = result.listCells[0]
org.apache.hadoop.hbase.util.Bytes::toLong(cell.getValue) org.apache.hadoop.hbase.util.Bytes::toLong(cell.getValue)
end end
@ -481,12 +481,12 @@ EOF
row = iter.next row = iter.next
key = org.apache.hadoop.hbase.util.Bytes::toStringBinary(row.getRow) key = org.apache.hadoop.hbase.util.Bytes::toStringBinary(row.getRow)
row.list.each do |kv| row.listCells.each do |c|
family = String.from_java_bytes(kv.getFamily) family = String.from_java_bytes(c.getFamily)
qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getQualifier) qualifier = org.apache.hadoop.hbase.util.Bytes::toStringBinary(c.getQualifier)
column = "#{family}:#{qualifier}" column = "#{family}:#{qualifier}"
cell = to_string(column, kv, maxlength) cell = to_string(column, c, maxlength)
if block_given? if block_given?
yield(key, "column=#{column}, #{cell}") yield(key, "column=#{column}, #{cell}")

View File

@ -92,7 +92,7 @@ EOF
iter = scanner.iterator iter = scanner.iterator
while iter.hasNext while iter.hasNext
row = iter.next row = iter.next
row.list.each do |cell| row.listCells.each do |cell|
put = org.apache.hadoop.hbase.client.Put.new(row.getRow) put = org.apache.hadoop.hbase.client.Put.new(row.getRow)
put.add(cell) put.add(cell)
t.set_cell_permissions(put, permissions) t.set_cell_permissions(put, permissions)

View File

@ -57,7 +57,7 @@ EOF
iter = scanner.iterator iter = scanner.iterator
while iter.hasNext while iter.hasNext
row = iter.next row = iter.next
row.list.each do |cell| row.listCells.each do |cell|
put = org.apache.hadoop.hbase.client.Put.new(row.getRow) put = org.apache.hadoop.hbase.client.Put.new(row.getRow)
put.add(cell) put.add(cell)
t.set_cell_visibility(put, visibility) t.set_cell_visibility(put, visibility)