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

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

As of now there is no way to pass Tags directly from client. We will strip 
them. (Though it is possible by using codec with Tag support)
Tags will come in the Cell (when it reaches Memstore) if Cell is having ACL or 
visibility or TTL.  But at that time, it will be TagRewriteCell on which 
getTagsLength() call don't have any parsing. It is simple array length calc. 
When the Cell dont have any tags, it will be NoTagsKeyValue on which 
getTagsLength() call just return 0.  
Considering these, as of now, there is no need for any fix. (When tags are 
there or not).  We may close it.
Or may we just write some comments as stated above in the mentioned code area 
(As Ted suggested).  Later when we support tags to passed in a cell directly 
from client, we can see how we can optimize it.

> Optimize setting tagsPresent in DefaultMemStore.java
> ----------------------------------------------------
>
>                 Key: HBASE-14995
>                 URL: https://issues.apache.org/jira/browse/HBASE-14995
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 2.0.0, 1.2.0
>            Reporter: huaxiang sun
>            Assignee: huaxiang sun
>            Priority: Minor
>         Attachments: HBASE-14995-v001.patch, HBASE-14995-v002.patch
>
>
> The current implementation calls e.getTagsLength() for each cell. Once 
> tagsPresent is set, e.getTagsLength() can be avoided.
> {code}
>   private boolean addToCellSet(Cell e) {
>     boolean b = this.cellSet.add(e);
>     // In no tags case this NoTagsKeyValue.getTagsLength() is a cheap call.
>     // When we use ACL CP or Visibility CP which deals with Tags during
>     // mutation, the TagRewriteCell.getTagsLength() is a cheaper call. We do 
> not
>     // parse the byte[] to identify the tags length.
>     if(e.getTagsLength() > 0) {
>       tagsPresent = true;
>     }
>     setOldestEditTimeToNow();
>     return b;
>   }
> {code}



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

Reply via email to