Package org.apache.hadoop.hbase
Interface ExtendedCell
- All Known Implementing Classes:
BufferedDataBlockEncoder.OffheapDecodedExtendedCell,BufferedDataBlockEncoder.OnheapDecodedCell,ByteBufferChunkKeyValue,ByteBufferExtendedCell,ByteBufferKeyOnlyKeyValue,ByteBufferKeyValue,IndividualBytesFieldCell,KeyOnlyFilter.KeyOnlyByteBufferExtendedCell,KeyValue,KeyValue.KeyOnlyKeyValue,MapReduceExtendedCell,Mutation.CellWrapper,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
Extension to
Cell with server side required functions. Server side Cell implementations
must implement this.-
Nested Class Summary
-
Field Summary
FieldsFields inherited from interface org.apache.hadoop.hbase.RawCell
MAX_TAGS_LENGTH -
Method Summary
Modifier and TypeMethodDescriptiondefault ExtendedCellDoes a deep copy of the contents to a new memory area and returns it as a new cell.default intExtracts the id of the backing bytebuffer of this cell if it was obtained from fixed sized chunks as in case of MemstoreLABlongA region-specific unique monotonically increasing sequence ID given to each Cell.default intReturns Serialized size (defaults to include tag length).default intgetSerializedSize(boolean withTags) KeyValue formatbyte[]Contiguous raw bytes representing tags that may start at any index in the containing array.intHBase internally uses 2 bytes to store tags length in Cell.intReturns the first offset where the tags start in the CellbyteReturns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etcvoidsetSequenceId(long seqId) Sets with the given seqId.voidsetTimestamp(byte[] ts) Sets with the given timestamp.voidsetTimestamp(long ts) Sets with the given timestamp.default intwrite(OutputStream out, boolean withTags) Write this cell to an OutputStream in aKeyValueformat.default voidwrite(ByteBuffer buf, int offset) Write this Cell into the given buf's offset in aKeyValueformat.Methods inherited from interface org.apache.hadoop.hbase.Cell
getFamilyArray, getFamilyLength, getFamilyOffset, getQualifierArray, getQualifierLength, getQualifierOffset, getRowArray, getRowLength, getRowOffset, getTimestamp, getType, getValueArray, getValueLength, getValueOffset
-
Field Details
-
CELL_NOT_BASED_ON_CHUNK
- See Also:
-
-
Method Details
-
write
Write this cell to an OutputStream in aKeyValueformat.
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 writtenwithTags- Whether to write tags.- Returns:
- how many bytes are written.
- Throws:
IOException
-
getSerializedSize
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
KeyValueformat.
-
getSerializedSize
Returns Serialized size (defaults to include tag length).- Specified by:
getSerializedSizein interfaceCell
-
write
Write this Cell into the given buf's offset in aKeyValueformat.- 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
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
Sets with the given seqId.- Parameters:
seqId- sequence ID- Throws:
IOException
-
setTimestamp
Sets with the given timestamp.- Parameters:
ts- timestamp- Throws:
IOException
-
setTimestamp
Sets with the given timestamp.- Parameters:
ts- buffer containing the timestamp value- Throws:
IOException
-
getSequenceId
long 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 forHConstants.KEEP_SEQID_PERIODdays, but generally becomes irrelevant after the cell's row is no longer involved in any operations that require strict consistency.- Specified by:
getSequenceIdin interfaceCell- Returns:
- seqId (always > 0 if exists), or 0 if it no longer exists
-
getTagsArray
byte[] getTagsArray()Contiguous raw bytes representing tags that may start at any index in the containing array.- Specified by:
getTagsArrayin interfaceCell- Returns:
- the tags byte array
-
getTagsOffset
int getTagsOffset()Returns the first offset where the tags start in the Cell- Specified by:
getTagsOffsetin interfaceCell
-
getTagsLength
int 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.- Specified by:
getTagsLengthin interfaceCell- Returns:
- the total length of the tags in the Cell.
-
getTypeByte
byte getTypeByte()Returns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etc- Specified by:
getTypeBytein interfaceCell
-