Review Board 1.7.22

HBASE-5625 Avoid byte buffer allocations when reading a value from a Result object

Review Request #4559 - Created March 29, 2012 and updated

Ted Yu
When calling Result.getValue(), an extra dummy KeyValue and its associated underlying byte array are allocated, as well as a persistent buffer that will contain the returned value.

These can be avoided by reusing a static array for the dummy object and by passing a ByteBuffer object as a value destination buffer to the read method.

The current functionality is maintained, and we have added a separate method call stack that employs the described changes. I will provide more details with the patch.
Posted (March 29, 2012, 5:58 p.m.)
Overall, I am impressed with quality of code.
Minor comments below.
There are some white spaces to be removed.
buffer.length should be included in message
How about 'Create a byte array and write KeyValue into it' ?
An empty line between 666 and 667 would be desirable.
Empty line not needed.
Add empty line before line 1435.
This empty line can be removed.
This line can be removed, as well as line 160.