Interface ExtendedCell

All Superinterfaces:
Cell, HeapSize, RawCell
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

@Private public interface ExtendedCell extends RawCell, HeapSize
Extension to Cell with server side required functions. Server side Cell implementations must implement this.
  • Field Details

  • Method Details

    • write

      default int write(OutputStream out, boolean withTags) throws IOException
      Write this cell to an OutputStream in a KeyValue format.
      KeyValue format
      <4 bytes keylength> <4 bytes valuelength> <2 bytes rowlength> <row> <1 byte columnfamilylength> <columnfamily> <columnqualifier> <8 bytes timestamp> <1 byte keytype> <value> <2 bytes tagslength> <tags>
      Parameters:
      out - Stream to which cell has to be written
      withTags - Whether to write tags.
      Returns:
      how many bytes are written.
      Throws:
      IOException
    • getSerializedSize

      default int getSerializedSize(boolean withTags)
      KeyValue format

      <4 bytes keylength> <4 bytes valuelength> <2 bytes rowlength> <row> <1 byte columnfamilylength> <columnfamily> <columnqualifier> <8 bytes timestamp> <1 byte keytype> <value> <2 bytes tagslength> <tags>

      Parameters:
      withTags - Whether to write tags.
      Returns:
      Bytes count required to serialize this Cell in a KeyValue format.
    • getSerializedSize

      default int getSerializedSize()
      Returns Serialized size (defaults to include tag length).
      Specified by:
      getSerializedSize in interface Cell
    • write

      default void write(ByteBuffer buf, int offset)
      Write this Cell into the given buf's offset in a KeyValue format.
      Parameters:
      buf - The buffer where to write the Cell.
      offset - The offset within buffer, to write the Cell.
    • deepClone

      Does a deep copy of the contents to a new memory area and returns it as a new cell.
      Returns:
      The deep cloned cell
    • getChunkId

      default int getChunkId()
      Extracts the id of the backing bytebuffer of this cell if it was obtained from fixed sized chunks as in case of MemstoreLAB
      Returns:
      the chunk id if the cell is backed by fixed sized Chunks, else return CELL_NOT_BASED_ON_CHUNK; i.e. -1.
    • setSequenceId

      void setSequenceId(long seqId) throws IOException
      Sets with the given seqId.
      Parameters:
      seqId - sequence ID
      Throws:
      IOException
    • setTimestamp

      void setTimestamp(long ts) throws IOException
      Sets with the given timestamp.
      Parameters:
      ts - timestamp
      Throws:
      IOException
    • setTimestamp

      void setTimestamp(byte[] ts) throws IOException
      Sets with the given timestamp.
      Parameters:
      ts - buffer containing the timestamp value
      Throws:
      IOException
    • getSequenceId

      A region-specific unique monotonically increasing sequence ID given to each Cell. It always exists for cells in the memstore but is not retained forever. It will be kept for HConstants.KEEP_SEQID_PERIOD days, but generally becomes irrelevant after the cell's row is no longer involved in any operations that require strict consistency.
      Returns:
      seqId (always > 0 if exists), or 0 if it no longer exists
    • getTypeByte

      byte getTypeByte()
      Returns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etc
    • getType

      default Cell.Type getType()
      Typically, at server side, you'd better always use the getTypeByte() as this method does not expose the Maximum and Minimum because they will not be returned to client, but at server side, we do have cells with these types so if you use this method it will cause exceptions.
      Specified by:
      getType in interface Cell
      Returns:
      The data type this cell: one of Put, Delete, etc