public static long getKeyValueDataStructureSize(int klength, int vlength, int tagsLength) {
    if (tagsLength == 0) {
      return (long) KeyValue.KEYVALUE_INFRASTRUCTURE_SIZE + klength + vlength;
    }
    return (long) KeyValue.KEYVALUE_WITH_TAGS_INFRASTRUCTURE_SIZE + klength + vlength + tagsLength;
  }
Computes the number of bytes that a <code>KeyValue</code> instance with the provided
characteristics would take up for its underlying data structure.
@param klength    key length
@param vlength    value length
@param tagsLength total length of the tags
@return the <code>KeyValue</code> data structure length
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java