Interface Cell
- All Superinterfaces:
HeapSize
- All Known Subinterfaces:
ExtendedCell
,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
1) row 2) column family 3) column qualifier 4) timestamp 5) type 6) MVCC version 7) value
Uniqueness is determined by the combination of row, column family, column qualifier, timestamp, and type.
The natural comparator will perform a bitwise comparison on row, column family, and column qualifier. Less intuitively, it will then treat the greater timestamp as the lesser value with the goal of sorting newer cells first.
Cell implements Comparable<Cell> which is only meaningful when comparing to other keys in the same table. It uses CellComparator which does not work on the -ROOT- and hbase:meta tables.
In the future, we may consider adding a boolean isOnHeap() method and a getValueBuffer() method that can be used to pass a value directly from an off-heap ByteBuffer to the network without copying into an on-heap byte[].
Historic note: the original Cell implementation (KeyValue) requires that all fields be encoded as consecutive bytes in the same byte[], whereas this interface allows fields to reside in separate byte[]'s.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The valid types for user to build the cell. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Contiguous bytes composed of legal HDFS filename characters which may start at any index in the containing array.byte
Returns Number of family bytes.int
Returns Array index of first family bytebyte[]
Contiguous raw bytes that may start at any index in the containing array.int
Returns Number of qualifier bytes.int
Returns Array index of first qualifier bytebyte[]
Contiguous raw bytes that may start at any index in the containing array.short
Returns Number of row bytes.int
Returns Array index of first row byteint
Returns Serialized size (defaults to include tag length if has some tags).long
Return a long value representing time at which this cell was "Put" into the row.getType()
Returns the type of cell in a human readable format usingCell.Type
.byte[]
Contiguous raw bytes that may start at any index in the containing array.int
Returns Number of value bytes.int
Returns Array index of first value byte
-
Method Details
-
getRowArray
byte[] getRowArray()Contiguous raw bytes that may start at any index in the containing array. Max length is Short.MAX_VALUE which is 32,767 bytes.- Returns:
- The array containing the row bytes.
-
getRowOffset
int getRowOffset()Returns Array index of first row byte -
getRowLength
short getRowLength()Returns Number of row bytes. Must be < rowArray.length - offset. -
getFamilyArray
byte[] getFamilyArray()Contiguous 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.- Returns:
- the array containing the family bytes.
-
getFamilyOffset
int getFamilyOffset()Returns Array index of first family byte -
getFamilyLength
byte getFamilyLength()Returns Number of family bytes. Must be < familyArray.length - offset. -
getQualifierArray
byte[] getQualifierArray()Contiguous raw bytes that may start at any index in the containing array.- Returns:
- The array containing the qualifier bytes.
-
getQualifierOffset
int getQualifierOffset()Returns Array index of first qualifier byte -
getQualifierLength
int getQualifierLength()Returns Number of qualifier bytes. Must be < qualifierArray.length - offset. -
getTimestamp
long getTimestamp()Return 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. -
getType
Returns the type of cell in a human readable format usingCell.Type
.Note : This does not expose the internal types of Cells like
KeyValue.Type.Maximum
andKeyValue.Type.Minimum
- Returns:
- The data type this cell: one of Put, Delete, etc
-
getValueArray
byte[] getValueArray()Contiguous 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.- Returns:
- The array containing the value bytes.
-
getValueOffset
int getValueOffset()Returns Array index of first value byte -
getValueLength
int getValueLength()Returns Number of value bytes. Must be < valueArray.length - offset. -
getSerializedSize
int getSerializedSize()Returns Serialized size (defaults to include tag length if has some tags).
-