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

Enis Soztutar commented on HBASE-12047:
---------------------------------------

LGTM overall for branch1+. 

When do we use CellUtil.estimatedLengthOf() vs KeyValueUtil.length() ? 
{code}
-      for (Cell kv : results) {
-        totalSize += KeyValueUtil.ensureKeyValue(kv).getLength();
+      for (Cell cell : results) {
+        totalSize += KeyValueUtil.length(cell);
       }
{code}

Time to do a Cell.Type instead of KV.Type (something to consider for another 
jira)? 
{code}
-        if (type == MutationType.DELETE || (type == MutationType.PUT && 
CellUtil.isDelete(kv))) {
-          KeyValue.Type keyValueType = KeyValue.Type.codeToType(kv.getType());
+        if (type == MutationType.DELETE || (type == MutationType.PUT && 
CellUtil.isDelete(cell))) {
+          KeyValue.Type keyValueType = 
KeyValue.Type.codeToType(cell.getTypeByte());
           valueBuilder.setDeleteType(toDeleteType(keyValueType));
{code}

> 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