diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java index 626f0412ccf..53b319b898b 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java @@ -170,6 +170,7 @@ public interface Cell { int getValueLength(); /** + * Contiguous raw bytes representing tags that may start at any index in the containing array. * @return the tags byte array */ byte[] getTagsArray(); @@ -180,6 +181,12 @@ public interface Cell { int getTagsOffset(); /** + * HBase internally uses 2 bytes to store tags length in Cell. + * As the tags length is always a non-negative number, to make good use of the sign bit, + * the max of tags length is defined as {@link TagUtil#MAX_TAGS_LENGTH}, which is 2 * Short.MAX_VALUE + 1 = 65535. + * As a result, the return type is int, because a short is not capable of handling that. + * Please note that even if the return type is int, the max tags length is far less than Integer.MAX_VALUE. + * * @return the total length of the tags in the Cell. */ int getTagsLength();