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

Anoop Sam John commented on HBASE-12047:
----------------------------------------

Thanks [~enis]
bq.When do we use CellUtil.estimatedLengthOf() vs KeyValueUtil.length() ?
As you know the CellUtil method is just an estimate. The places in the 
HFileWriter area where we write Cells with KV serialization, we must use the 
KeyValueUtil method. This has to be exact length.  In many other places, we 
calculate the length for metric reporting etc. There we can just use 
estimatedLengthOf IMO.  The above sample you showed is metric related. I think 
I can change to estimatedLengthOf. Good Q and good catch.

bq.Time to do a Cell.Type instead of KV.Type (something to consider for another 
jira)? 
Yes another good clean up. We can do in another Jira.

> Avoid usage of KeyValueUtil#ensureKeyValue in simple cases
> ----------------------------------------------------------
>
>                 Key: HBASE-12047
>                 URL: https://issues.apache.org/jira/browse/HBASE-12047
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0, 0.99.1
>
>         Attachments: HBASE-12047.patch, HBASE-12047_V2.patch
>
>
> The patch avoids the usage from some obvious simple cases.



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

Reply via email to