[ 
https://issues.apache.org/jira/browse/HBASE-14882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15711187#comment-15711187
 ] 

Xiang Li commented on HBASE-14882:
----------------------------------

Hi [~anoop.hbase]

I uploaded patch 004 for master and triggered HADOOP-QA.
Patch 004 mainly addresses:
1. Implement ExtendedCell (to override 2 write() and getSerializedSize())
2. Enhance UT. Previously, the expected value of assert was hard-coded. I 
changed them to verify if IndividualBytesFieldCell has the same 
behaviors/outputs as KeyValue when given the same inputs.

For the implementation of 2 write() and getSerializedSize(), I used the 
functions in KeyValueUtil as much as I can. I also implemented the logic myself 
according to KeyValue format, which I think might be a little more efficient, 
at least no copy is made, and write into byte buffer or output stream directly. 
The reason why I chose to use the functions in KeyValueUtil is that it saves a 
lot of efforts of the maintenance in the future, when somebody would like to 
modify the key value format. He does not need to care about the implementation 
in IndividualBytesFieldCell, as long as the functions in KeyValueUtil are 
modified. The drawback is that it might be less efficient than that implemented 
directly, when calling write().  What is your opinion?

> Provide a Put API that adds the provided family, qualifier, value without 
> copying
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-14882
>                 URL: https://issues.apache.org/jira/browse/HBASE-14882
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 1.2.0
>            Reporter: Jerry He
>            Assignee: Xiang Li
>             Fix For: 2.0.0
>
>         Attachments: HBASE-14882.master.000.patch, 
> HBASE-14882.master.001.patch, HBASE-14882.master.002.patch, 
> HBASE-14882.master.003.patch, HBASE-14882.master.004.patch
>
>
> In the Put API, we have addImmutable()
> {code}
>  /**
>    * See {@link #addColumn(byte[], byte[], byte[])}. This version expects
>    * that the underlying arrays won't change. It's intended
>    * for usage internal HBase to and for advanced client applications.
>    */
>   public Put addImmutable(byte [] family, byte [] qualifier, byte [] value)
> {code}
> But in the implementation, the family, qualifier and value are still being 
> copied locally to create kv.
> Hopefully we should provide an API that truly uses immutable family, 
> qualifier and value.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to