Class BufferedDataBlockEncoder.OnheapDecodedCell
java.lang.Object
org.apache.hadoop.hbase.io.encoding.BufferedDataBlockEncoder.OnheapDecodedCell
- All Implemented Interfaces:
Cell,ExtendedCell,HeapSize,RawCell
- Enclosing class:
- BufferedDataBlockEncoder
protected static class BufferedDataBlockEncoder.OnheapDecodedCell
extends Object
implements ExtendedCell
Copies only the key part of the keybuffer by doing a deep copy and passes the seeker state
members for taking a clone. Note that the value byte[] part is still pointing to the
currentBuffer and represented by the valueOffset and valueLength
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byteprivate intprivate static final longprivate byte[]private intprivate intprivate shortprivate longprivate byte[]private intprivate intprivate longprivate byteprivate byte[]private intprivate intFields inherited from interface org.apache.hadoop.hbase.ExtendedCell
CELL_NOT_BASED_ON_CHUNKFields inherited from interface org.apache.hadoop.hbase.RawCell
MAX_TAGS_LENGTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOnheapDecodedCell(byte[] keyBuffer, short rowLength, int familyOffset, byte familyLength, int qualOffset, int qualLength, long timeStamp, byte typeByte, byte[] valueBuffer, int valueOffset, int valueLen, long seqId, byte[] tagsBuffer, int tagsOffset, int tagsLength) -
Method Summary
Modifier and TypeMethodDescriptionDoes a deep copy of the contents to a new memory area and returns it as a new cell.byte[]Contiguous bytes composed of legal HDFS filename characters which may start at any index in the containing array.byteReturns Number of family bytes.intReturns Array index of first family bytebyte[]Contiguous raw bytes that may start at any index in the containing array.intReturns Number of qualifier bytes.intReturns Array index of first qualifier bytebyte[]Contiguous raw bytes that may start at any index in the containing array.shortReturns Number of row bytes.intReturns Array index of first row bytelongA region-specific unique monotonically increasing sequence ID given to each Cell.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 CelllongReturn a long value representing time at which this cell was "Put" into the row.byteReturns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etcbyte[]Contiguous raw bytes that may start at any index in the containing array.intReturns Number of value bytes.intReturns Array index of first value bytelongheapSize()Return the approximate 'exclusive deep size' of implementing object.voidsetSequenceId(long seqId) Sets with the given seqId.voidsetTimestamp(byte[] ts) Sets with the given timestamp.voidsetTimestamp(long ts) Sets with the given timestamp.toString()intwrite(OutputStream out, boolean withTags) Write this cell to an OutputStream in aKeyValueformat.voidwrite(ByteBuffer buf, int offset) Write this Cell into the given buf's offset in aKeyValueformat.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.ExtendedCell
getChunkId, getSerializedSize
-
Field Details
-
FIXED_OVERHEAD
-
keyOnlyBuffer
-
rowLength
-
familyOffset
-
familyLength
-
qualifierOffset
-
qualifierLength
-
timeStamp
-
typeByte
-
valueBuffer
-
valueOffset
-
valueLength
-
tagsBuffer
-
tagsOffset
-
tagsLength
-
seqId
-
-
Constructor Details
-
OnheapDecodedCell
protected OnheapDecodedCell(byte[] keyBuffer, short rowLength, int familyOffset, byte familyLength, int qualOffset, int qualLength, long timeStamp, byte typeByte, byte[] valueBuffer, int valueOffset, int valueLen, long seqId, byte[] tagsBuffer, int tagsOffset, int tagsLength)
-
-
Method Details
-
getRowArray
Description copied from interface:CellContiguous raw bytes that may start at any index in the containing array. Max length is Short.MAX_VALUE which is 32,767 bytes.- Specified by:
getRowArrayin interfaceCell- Returns:
- The array containing the row bytes.
-
getFamilyArray
Description copied from interface:CellContiguous bytes composed of legal HDFS filename characters which may start at any index in the containing array. Max length is Byte.MAX_VALUE, which is 127 bytes.- Specified by:
getFamilyArrayin interfaceCell- Returns:
- the array containing the family bytes.
-
getQualifierArray
Description copied from interface:CellContiguous raw bytes that may start at any index in the containing array.- Specified by:
getQualifierArrayin interfaceCell- Returns:
- The array containing the qualifier bytes.
-
getRowOffset
Description copied from interface:CellReturns Array index of first row byte- Specified by:
getRowOffsetin interfaceCell
-
getRowLength
Description copied from interface:CellReturns Number of row bytes. Must be < rowArray.length - offset.- Specified by:
getRowLengthin interfaceCell
-
getFamilyOffset
Description copied from interface:CellReturns Array index of first family byte- Specified by:
getFamilyOffsetin interfaceCell
-
getFamilyLength
Description copied from interface:CellReturns Number of family bytes. Must be < familyArray.length - offset.- Specified by:
getFamilyLengthin interfaceCell
-
getQualifierOffset
Description copied from interface:CellReturns Array index of first qualifier byte- Specified by:
getQualifierOffsetin interfaceCell
-
getQualifierLength
Description copied from interface:CellReturns Number of qualifier bytes. Must be < qualifierArray.length - offset.- Specified by:
getQualifierLengthin interfaceCell
-
getTimestamp
Description copied from interface:CellReturn a long value representing time at which this cell was "Put" into the row. Typically represents the time of insertion, but can be any value from 0 to Long.MAX_VALUE.- Specified by:
getTimestampin interfaceCell
-
getTypeByte
Description copied from interface:ExtendedCellReturns The byte representation of the KeyValue.TYPE of this cell: one of Put, Delete, etc- Specified by:
getTypeBytein interfaceCell- Specified by:
getTypeBytein interfaceExtendedCell
-
getSequenceId
Description copied from interface:ExtendedCellA 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- Specified by:
getSequenceIdin interfaceExtendedCell- Returns:
- seqId (always > 0 if exists), or 0 if it no longer exists
-
getValueArray
Description copied from interface:CellContiguous raw bytes that may start at any index in the containing array. Max length is Integer.MAX_VALUE which is 2,147,483,647 bytes.- Specified by:
getValueArrayin interfaceCell- Returns:
- The array containing the value bytes.
-
getValueOffset
Description copied from interface:CellReturns Array index of first value byte- Specified by:
getValueOffsetin interfaceCell
-
getValueLength
Description copied from interface:CellReturns Number of value bytes. Must be < valueArray.length - offset.- Specified by:
getValueLengthin interfaceCell
-
getTagsArray
Description copied from interface:ExtendedCellContiguous raw bytes representing tags that may start at any index in the containing array.- Specified by:
getTagsArrayin interfaceCell- Specified by:
getTagsArrayin interfaceExtendedCell- Returns:
- the tags byte array
-
getTagsOffset
Description copied from interface:ExtendedCellReturns the first offset where the tags start in the Cell- Specified by:
getTagsOffsetin interfaceCell- Specified by:
getTagsOffsetin interfaceExtendedCell
-
getTagsLength
Description copied from interface:ExtendedCellHBase 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- Specified by:
getTagsLengthin interfaceExtendedCell- Returns:
- the total length of the tags in the Cell.
-
toString
-
setSequenceId
Description copied from interface:ExtendedCellSets with the given seqId.- Specified by:
setSequenceIdin interfaceExtendedCell- Parameters:
seqId- sequence ID
-
heapSize
Description copied from interface:HeapSizeReturn the approximate 'exclusive deep size' of implementing object. Includes count of payload and hosting object sizings. -
write
Description copied from interface:ExtendedCellWrite 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>- Specified by:
writein interfaceExtendedCell- Parameters:
out- Stream to which cell has to be writtenwithTags- Whether to write tags.- Returns:
- how many bytes are written.
- Throws:
IOException
-
getSerializedSize
Description copied from interface:ExtendedCellKeyValue 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>- Specified by:
getSerializedSizein interfaceExtendedCell- Parameters:
withTags- Whether to write tags.- Returns:
- Bytes count required to serialize this Cell in a
KeyValueformat.
-
write
Description copied from interface:ExtendedCellWrite this Cell into the given buf's offset in aKeyValueformat.- Specified by:
writein interfaceExtendedCell- Parameters:
buf- The buffer where to write the Cell.offset- The offset within buffer, to write the Cell.
-
setTimestamp
Description copied from interface:ExtendedCellSets with the given timestamp.- Specified by:
setTimestampin interfaceExtendedCell- Parameters:
ts- timestamp- Throws:
IOException
-
setTimestamp
Description copied from interface:ExtendedCellSets with the given timestamp.- Specified by:
setTimestampin interfaceExtendedCell- Parameters:
ts- buffer containing the timestamp value- Throws:
IOException
-
deepClone
Description copied from interface:ExtendedCellDoes a deep copy of the contents to a new memory area and returns it as a new cell.- Specified by:
deepClonein interfaceExtendedCell- Returns:
- The deep cloned cell
-