Converts a protobuf result into a list of KeyValue. @param res The protobuf'ed results from which to extract the KVs. @param buf The buffer from which the protobuf was read. @param cell_size The number of bytes of the cell block that follows, in the buffer.
(final ClientPB.Result res,
final ChannelBuffer buf,
final int cell_size)
| 744 | * in the buffer. |
| 745 | */ |
| 746 | static ArrayList<KeyValue> convertResult(final ClientPB.Result res, |
| 747 | final ChannelBuffer buf, |
| 748 | final int cell_size) { |
| 749 | final int cell_kvs = RegionClient.numberOfKeyValuesAhead(buf, cell_size); |
| 750 | final int size = res.getCellCount(); |
| 751 | final ArrayList<KeyValue> rows = new ArrayList<KeyValue>(size + cell_kvs); |
| 752 | KeyValue kv = null; |
| 753 | for (int i = 0; i < size; i++) { |
| 754 | kv = KeyValue.fromCell(res.getCell(i), kv); |
| 755 | rows.add(kv); |
| 756 | } |
| 757 | for (int i = 0; i < cell_kvs; i++) { |
| 758 | final int kv_length = buf.readInt(); |
| 759 | kv = KeyValue.fromBuffer(buf, kv); |
| 760 | rows.add(kv); |
| 761 | } |
| 762 | return rows; |
| 763 | } |
| 764 | |
| 765 | /** |
| 766 | * Converts a protobuf result into a list of {@link KeyValue} and parses a |
no test coverage detected