apache/incubator-phoenix — pull request #14 by JamesRTaylor (2014-03-05 19:17:58+00:00)
Title: Use KeyValueBuilder where possible

Using ClientKeyValue where possible. Looks like it's not going to work on the server-side, as the memstore expects to be able to get a backing buffer for the KeyValue (see below). Would it be possible to have this code in the memstore go through a KeyValue method to get the backing buffer? Then we could manufacture one for the ClientKeyValue impl.

```
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.UnsupportedOperationException: ClientKeyValue does not support a single backing buffer.
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatchCallback(HConnectionManager.java:1708)
at org.apache.hadoop.hbase.client.CoprocessorHConnection.processBatchCallback(CoprocessorHConnection.java:39)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1560)
at org.apache.hadoop.hbase.client.CoprocessorHConnection.processBatch(CoprocessorHConnection.java:39)
at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:779)
at org.apache.hadoop.hbase.coprocessor.CoprocessorHost$Environment$HTableWrapper.batch(CoprocessorHost.java:522)
at org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter$1.call(ParallelWriterIndexCommitter.java:144)
at org.apache.phoenix.hbase.index.write.ParallelWriterIndexCommitter$1.call(ParallelWriterIndexCommitter.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.RuntimeException: java.lang.UnsupportedOperationException: ClientKeyValue does not support a single backing buffer.
at org.apache.hadoop.hbase.client.ServerCallable.withoutRetries(ServerCallable.java:235)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$3.call(HConnectionManager.java:1544)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$3.call(HConnectionManager.java:1532)
... 5 more
Caused by: java.lang.UnsupportedOperationException: ClientKeyValue does not support a single backing buffer.
at org.apache.phoenix.client.ClientKeyValue.getBuffer(ClientKeyValue.java:500)
at org.apache.hadoop.hbase.regionserver.MemStore.maybeCloneWithAllocator(MemStore.java:259)
at org.apache.hadoop.hbase.regionserver.MemStore.add(MemStore.java:207)
at org.apache.hadoop.hbase.regionserver.Store.add(Store.java:512)
at org.apache.hadoop.hbase.regionserver.HRegion.applyFamilyMapToMemstore(HRegion.java:2982)
at org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchMutation(HRegion.java:2426)
at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2190)
at org.apache.hadoop.hbase.regionserver.HRegionServer.multi(HRegionServer.java:3873)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$3$1.call(HConnectionManager.java:1537)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$3$1.call(HConnectionManager.java:1535)
at org.apache.hadoop.hbase.client.ServerCallable.withoutRetries(ServerCallable.java:229)
... 7 more
```