HBASE-18094 Display the return value of the command append
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
abf03da41d
commit
8c313d5be4
|
@ -244,7 +244,12 @@ EOF
|
||||||
set_op_ttl(append, ttl) if ttl
|
set_op_ttl(append, ttl) if ttl
|
||||||
end
|
end
|
||||||
append.add(family, qualifier, value.to_s.to_java_bytes)
|
append.add(family, qualifier, value.to_s.to_java_bytes)
|
||||||
@table.append(append)
|
result = @table.append(append)
|
||||||
|
return nil if result.isEmpty
|
||||||
|
|
||||||
|
# Fetch cell value
|
||||||
|
cell = result.listCells[0]
|
||||||
|
org.apache.hadoop.hbase.util.Bytes::toStringBinary(cell.getValue)
|
||||||
end
|
end
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -40,8 +40,10 @@ EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
def append(table, row, column, value, args={})
|
def append(table, row, column, value, args={})
|
||||||
format_simple_command do
|
format_simple_command do
|
||||||
table._append_internal(row, column, value, args)
|
if current_value = table._append_internal(row, column, value, args)
|
||||||
|
puts "CURRENT VALUE = #{current_value}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -183,6 +183,7 @@ module Hbase
|
||||||
|
|
||||||
define_test "append should work with value" do
|
define_test "append should work with value" do
|
||||||
@test_table.append("123", 'x:cnt2', '123')
|
@test_table.append("123", 'x:cnt2', '123')
|
||||||
|
assert_equal("123123", @test_table._append_internal("123", 'x:cnt2', '123'))
|
||||||
end
|
end
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue