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

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

{code}
/**
   * @return the total length of the tags in the Cell.
   * @deprecated use {@link #getTagsLengthUnsigned()} which can handle tags 
length upto 65535.
   */
  @Deprecated
  @InterfaceStability.Unstable
  short getTagsLength();
{code}
The above is from 0.98.  We first added tags length as short.  But 0.98 only 
deprecated it and went with int.  This is because, even if we store it in 2 
bytes, we make use of the fact that the length can not be -ve. So make use of 
the sign bit also and can go double the max short value.  So in order to return 
that, the type has to be bigger than short and that is int.  Hope am clarifying 
it for u.


> Cell#getTagsLength() returns a int, but in KeyValue, tags length is a short
> ---------------------------------------------------------------------------
>
>                 Key: HBASE-17086
>                 URL: https://issues.apache.org/jira/browse/HBASE-17086
>             Project: HBase
>          Issue Type: Bug
>          Components:  Interface
>    Affects Versions: 2.0.0
>            Reporter: Xiang Li
>
> In the Cell interface, getTagsLength() returns a int
> But in the KeyValue implementation, tags length is a short. Also in 
> ExtendedCell, when explaining the KeyValue format, tags length is stated to 
> be 2 bytes
> Any plan to update Cell interface to make getTagsLength() returns a short ?



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

Reply via email to