Class TagUtil

java.lang.Object
org.apache.hadoop.hbase.TagUtil

@Private public final class TagUtil extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • asList

      public static List<Tag> asList(byte[] b, int offset, int length)
      Creates list of tags from given byte array, expected that it is in the expected tag format.
      Parameters:
      b - The byte array
      offset - The offset in array where tag bytes begin
      length - Total length of all tags bytes
      Returns:
      List of tags
    • readVIntValuePart

      public static Pair<Integer,Integer> readVIntValuePart(Tag tag, int offset) throws IOException
      Reads an int value stored as a VInt at tag's given offset.
      Parameters:
      tag - The Tag
      offset - The offset where VInt bytes begin
      Returns:
      A pair of the int value and number of bytes taken to store VInt
      Throws:
      IOException - When varint is malformed and not able to be read correctly
    • carryForwardTags

      public static List<Tag> carryForwardTags(ExtendedCell cell)
      Returns A List<Tag> of any Tags found in cell else null.
    • carryForwardTags

      public static List<Tag> carryForwardTags(List<Tag> tagsOrNull, ExtendedCell cell)
      Add to tagsOrNull any Tags cell is carrying or null if none.
    • concatTags

      public static byte[] concatTags(byte[] tags, ExtendedCell cell)
    • carryForwardTTLTag

      public static List<Tag> carryForwardTTLTag(List<Tag> tagsOrNull, long ttl)
      Returns Carry forward the TTL tag.
    • fromList

      public static byte[] fromList(List<Tag> tags)
      Write a list of tags into a byte array Note : these are all purely internal APIs. It helps in cases where we have set of tags and we would want to create a cell out of it. Say in Mobs we create a reference tags to indicate the presence of mob data. Also note that these are not exposed to CPs also
      Parameters:
      tags - The list of tags
      Returns:
      the serialized tag data as bytes