Class ArrayBackedTag

java.lang.Object
org.apache.hadoop.hbase.ArrayBackedTag
All Implemented Interfaces:
Tag

@Private @Evolving public class ArrayBackedTag extends Object implements Tag
This is a Tag implementation in which value is backed by an on heap byte array.
  • Field Details

    • type

      private final byte type
    • bytes

      private final byte[] bytes
    • offset

      private int offset
    • length

      private int length
  • Constructor Details

    • ArrayBackedTag

      public ArrayBackedTag(byte tagType, String tag)
      The special tag will write the length of each tag and that will be followed by the type and then the actual tag. So every time the length part is parsed we need to add + 1 byte to it to get the type and then get the actual tag.
    • ArrayBackedTag

      public ArrayBackedTag(byte tagType, byte[] tag)
      Format for a tag : <length of tag - 2 bytes><type code - 1 byte><tag> tag length is serialized using 2 bytes only but as this will be unsigned, we can have max tag length of (Short.MAX_SIZE * 2) +1. It includes 1 byte type length and actual tag bytes length.
    • ArrayBackedTag

      public ArrayBackedTag(byte[] bytes, int offset)
      Creates a Tag from the specified byte array and offset. Presumes bytes content starting at offset is formatted as a Tag blob. The bytes to include the tag type, tag length and actual tag bytes.
      Parameters:
      offset - offset to start of Tag
    • ArrayBackedTag

      public ArrayBackedTag(byte[] bytes, int offset, int length)
      Creates a Tag from the specified byte array, starting at offset, and for length length. Presumes bytes content starting at offset is formatted as a Tag blob.
  • Method Details