Interface RawCell

All Superinterfaces:
Cell, HeapSize
All Known Subinterfaces:
ExtendedCell
All Known Implementing Classes:
BufferedDataBlockEncoder.OffheapDecodedExtendedCell, BufferedDataBlockEncoder.OnheapDecodedCell, ByteBufferChunkKeyValue, ByteBufferExtendedCell, ByteBufferKeyOnlyKeyValue, ByteBufferKeyValue, IndividualBytesFieldCell, KeyOnlyFilter.KeyOnlyByteBufferExtendedCell, KeyOnlyFilter.KeyOnlyCell, KeyValue, KeyValue.KeyOnlyKeyValue, MapReduceExtendedCell, NoTagByteBufferChunkKeyValue, NoTagsByteBufferKeyValue, NoTagsKeyValue, PrivateCellUtil.EmptyByteBufferExtendedCell, PrivateCellUtil.EmptyCell, PrivateCellUtil.FirstOnRowByteBufferExtendedCell, PrivateCellUtil.FirstOnRowCell, PrivateCellUtil.FirstOnRowColByteBufferExtendedCell, PrivateCellUtil.FirstOnRowColCell, PrivateCellUtil.FirstOnRowColTSByteBufferExtendedCell, PrivateCellUtil.FirstOnRowColTSCell, PrivateCellUtil.FirstOnRowDeleteFamilyCell, PrivateCellUtil.LastOnRowByteBufferExtendedCell, PrivateCellUtil.LastOnRowCell, PrivateCellUtil.LastOnRowColByteBufferExtendedCell, PrivateCellUtil.LastOnRowColCell, PrivateCellUtil.TagRewriteByteBufferExtendedCell, PrivateCellUtil.TagRewriteCell, PrivateCellUtil.ValueAndTagRewriteByteBufferExtendedCell, PrivateCellUtil.ValueAndTagRewriteCell, SizeCachedByteBufferKeyValue, SizeCachedKeyValue, SizeCachedNoTagsByteBufferKeyValue, SizeCachedNoTagsKeyValue

@LimitedPrivate("Coprocesssor") public interface RawCell extends Cell
An extended version of Cell that allows CPs manipulate Tags.
  • Field Details

  • Method Details

    • getTagsArray

      byte[] getTagsArray()
      Contiguous raw bytes representing tags that may start at any index in the containing array.
      Returns:
      the tags byte array
    • getTagsOffset

      Return the first offset where the tags start in the Cell
    • getTagsLength

      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.
      Returns:
      the total length of the tags in the Cell.
    • cloneTags

      default byte[] cloneTags()
      Allows cloning the tags in the cell to a new byte[]
      Returns:
      the byte[] having the tags
    • getTags

      default Iterator<Tag> getTags()
      Creates a list of tags in the current cell
      Returns:
      a list of tags
    • getTag

      default Optional<Tag> getTag(byte type)
      Returns the specific tag of the given type
      Parameters:
      type - the type of the tag
      Returns:
      the specific tag if available or null
    • checkForTagsLength

      static void checkForTagsLength(int tagsLength)
      Check the length of tags. If it is invalid, throw IllegalArgumentException
      Parameters:
      tagsLength - the given length of tags
      Throws:
      IllegalArgumentException - if tagslength is invalid
    • createCell

      static Cell createCell(Cell cell, List<Tag> tags)
      Returns A new cell which is having the extra tags also added to it.