@InterfaceAudience.Public public interface Cell
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.
Modifier and Type | Method and Description |
---|---|
byte[] |
getFamilyArray()
Contiguous bytes composed of legal HDFS filename characters which may start at any index in the
containing array.
|
byte |
getFamilyLength() |
int |
getFamilyOffset() |
byte[] |
getQualifierArray()
Contiguous raw bytes that may start at any index in the containing array.
|
int |
getQualifierLength() |
int |
getQualifierOffset() |
byte[] |
getRowArray()
Contiguous raw bytes that may start at any index in the containing array.
|
short |
getRowLength() |
int |
getRowOffset() |
long |
getSequenceId()
A region-specific unique monotonically increasing sequence ID given to each Cell.
|
byte[] |
getTagsArray()
Contiguous raw bytes representing tags that may start at any index in the containing array.
|
int |
getTagsLength()
HBase internally uses 2 bytes to store tags length in Cell.
|
int |
getTagsOffset() |
long |
getTimestamp() |
byte |
getTypeByte() |
byte[] |
getValueArray()
Contiguous raw bytes that may start at any index in the containing array.
|
int |
getValueLength() |
int |
getValueOffset() |
byte[] getRowArray()
int getRowOffset()
short getRowLength()
byte[] getFamilyArray()
int getFamilyOffset()
byte getFamilyLength()
byte[] getQualifierArray()
int getQualifierOffset()
int getQualifierLength()
long getTimestamp()
byte getTypeByte()
long getSequenceId()
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.byte[] getValueArray()
int getValueOffset()
int getValueLength()
byte[] getTagsArray()
int getTagsOffset()
int getTagsLength()
TagUtil.MAX_TAGS_LENGTH
, which is 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.Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.