Interface Tag

All Known Implementing Classes:
ArrayBackedTag, ByteBufferTag

@LimitedPrivate("Coprocesssor") @Evolving public interface Tag
Tags are part of cells and helps to add metadata about them. Metadata could be ACLs, visibility labels, etc.

Each Tag is having a type (one byte) and value part. The max value length for a Tag is 65533.

See TagType for reserved tag types.

  • Field Details

  • Method Details

    • getType

      byte getType()
      Returns the tag type
    • getValueOffset

      Returns Offset of tag value within the backed buffer
    • getValueLength

      Returns Length of tag value within the backed buffer
    • hasArray

      boolean hasArray()
      Return true if the tag is backed by a byte array
    • getValueArray

      byte[] getValueArray()
      Return an array containing the value bytes if hasArray() returns true.

      Use getValueByteBuffer() otherwise.

    • getValueByteBuffer

      Returns The ByteBuffer containing the value bytes.
    • cloneValue

      static byte[] cloneValue(Tag tag)
      Returns tag value in a new byte array. Primarily for use client-side. If server-side, use getValueArray() with appropriate getValueOffset() and getValueLength() instead to save on allocations.
      Parameters:
      tag - The Tag whose value to be returned
      Returns:
      tag value in a new byte array.
    • getValueAsString

      static String getValueAsString(Tag tag)
      Converts the value bytes of the given tag into a String value
      Parameters:
      tag - The Tag
      Returns:
      value as String
    • matchingValue

      static boolean matchingValue(Tag t1, Tag t2)
      Matches the value part of given tags
      Parameters:
      t1 - Tag to match the value
      t2 - Tag to match the value
      Returns:
      True if values of both tags are same.
    • copyValueTo

      static void copyValueTo(Tag tag, byte[] out, int offset)
      Copies the tag's value bytes to the given byte array
      Parameters:
      tag - The Tag
      out - The byte array where to copy the Tag value.
      offset - The offset within 'out' array where to copy the Tag value.
    • getValueAsLong

      static long getValueAsLong(Tag tag)
      Converts the value bytes of the given tag into a long value
      Parameters:
      tag - The Tag
      Returns:
      value as long
    • getValueAsByte

      static byte getValueAsByte(Tag tag)
      Converts the value bytes of the given tag into a byte value
      Parameters:
      tag - The Tag
      Returns:
      value as byte