Package org.apache.hadoop.hbase
Class TagUtil
java.lang.Object
org.apache.hadoop.hbase.TagUtil
-
Field Summary
Modifier and TypeFieldDescriptionIterator returned when no Tags. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasList
(byte[] b, int offset, int length) Creates list of tags from given byte array, expected that it is in the expected tag format.carryForwardTags
(List<Tag> tagsOrNull, ExtendedCell cell) Add totagsOrNull
any Tagscell
is carrying or null if none.carryForwardTags
(ExtendedCell cell) Returns A List<Tag> of any Tags found incell
else null.carryForwardTTLTag
(List<Tag> tagsOrNull, long ttl) Returns Carry forward the TTL tag.static byte[]
concatTags
(byte[] tags, ExtendedCell cell) static byte[]
Write a list of tags into a byte array Note : these are all purely internal APIs.readVIntValuePart
(Tag tag, int offset) Reads an int value stored as a VInt at tag's given offset.
-
Field Details
-
EMPTY_TAGS_ITR
Iterator returned when no Tags. Used by CellUtil too.
-
-
Constructor Details
-
TagUtil
private TagUtil()
-
-
Method Details
-
asList
Creates list of tags from given byte array, expected that it is in the expected tag format.- Parameters:
b
- The byte arrayoffset
- The offset in array where tag bytes beginlength
- Total length of all tags bytes- Returns:
- List of tags
-
readVIntValuePart
Reads an int value stored as a VInt at tag's given offset.- Parameters:
tag
- The Tagoffset
- 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
Returns A List<Tag> of any Tags found incell
else null. -
carryForwardTags
Add totagsOrNull
any Tagscell
is carrying or null if none. -
concatTags
-
carryForwardTTLTag
Returns Carry forward the TTL tag. -
fromList
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
-