Class NoTagsByteBufferKeyValue

All Implemented Interfaces:
Cell, ExtendedCell, HeapSize, RawCell
Direct Known Subclasses:
NoTagByteBufferChunkKeyValue, SizeCachedNoTagsByteBufferKeyValue

@Private public class NoTagsByteBufferKeyValue extends ByteBufferKeyValue
An extension of the ByteBufferKeyValue where the tags length is always 0
  • Constructor Details

  • Method Details

    • getTagsArray

      public byte[] getTagsArray()
      Description copied from interface: RawCell
      Contiguous raw bytes representing tags that may start at any index in the containing array.
      Specified by:
      getTagsArray in interface RawCell
      Overrides:
      getTagsArray in class ByteBufferKeyValue
      Returns:
      the tags byte array
    • getTagsLength

      public int getTagsLength()
      Description copied from interface: RawCell
      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 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.
      Specified by:
      getTagsLength in interface RawCell
      Overrides:
      getTagsLength in class ByteBufferKeyValue
      Returns:
      the total length of the tags in the Cell.
    • getSerializedSize

      public int getSerializedSize(boolean withTags)
      Description copied from interface: ExtendedCell
      KeyValue format

      <4 bytes keylength> <4 bytes valuelength> <2 bytes rowlength> <row> <1 byte columnfamilylength> <columnfamily> <columnqualifier> <8 bytes timestamp> <1 byte keytype> <value> <2 bytes tagslength> <tags>

      Specified by:
      getSerializedSize in interface ExtendedCell
      Overrides:
      getSerializedSize in class ByteBufferKeyValue
      Parameters:
      withTags - Whether to write tags.
      Returns:
      Bytes count required to serialize this Cell in a KeyValue format.
    • deepClone

      Description copied from interface: ExtendedCell
      Does a deep copy of the contents to a new memory area and returns it as a new cell.
      Specified by:
      deepClone in interface ExtendedCell
      Overrides:
      deepClone in class ByteBufferKeyValue
      Returns:
      The deep cloned cell