Package org.apache.hadoop.hbase
Class CellUtil
java.lang.Object
org.apache.hadoop.hbase.CellUtil
Utility methods helpful for slinging
Cell
instances. Some methods below are for internal
use only and are marked InterfaceAudience.Private at the method level. Note that all such methods
have been marked deprecated in HBase-2.0 which will be subsequently removed in HBase-3.0-
Constructor Summary
ModifierConstructorDescriptionprivate
CellUtil()
Private constructor to keep this class from being instantiated. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
cloneFamily
(Cell cell) static void
cloneIfNecessary
(ArrayList<Cell> cells) static Cell
cloneIfNecessary
(Cell cell) static byte[]
cloneQualifier
(Cell cell) static byte[]
get individual arrays for testsstatic byte[]
Deprecated.As of HBase-2.0.static byte[]
cloneValue
(Cell cell) static final int
compare
(CellComparator comparator, Cell left, byte[] key, int offset, int length) Deprecated.As of HBase-2.0.static final int
compareColumns
(Cell left, byte[] right, int rfoffset, int rflength, int rqoffset, int rqlength) Compares the cell's column (family and qualifier) with the given byte[]static final int
compareFamilies
(Cell left, byte[] right, int roffset, int rlength) Compares the cell's family with the given byte[]static final int
compareQualifiers
(Cell left, byte[] right, int rOffset, int rLength) Compares the cell's qualifier with the given byte[]static int
copyFamilyTo
(Cell cell, byte[] destination, int destinationOffset) Copies the family to the given byte[]static int
copyFamilyTo
(Cell cell, ByteBuffer destination, int destinationOffset) Copies the family to the given bytebufferstatic int
copyQualifierTo
(Cell cell, byte[] destination, int destinationOffset) Copies the qualifier to the given byte[]static int
copyQualifierTo
(Cell cell, ByteBuffer destination, int destinationOffset) Copies the qualifier to the given bytebufferstatic byte[]
Copies the row to a new byte[]static int
Copies the row to the given byte[]static int
copyRowTo
(Cell cell, ByteBuffer destination, int destinationOffset) Copies the row to the given bytebufferstatic int
Deprecated.As of HBase-2.0.static int
copyTagTo
(Cell cell, ByteBuffer destination, int destinationOffset) Deprecated.As of HBase-2.0.static int
copyValueTo
(Cell cell, byte[] destination, int destinationOffset) Copies the value to the given byte[]static int
copyValueTo
(Cell cell, ByteBuffer destination, int destinationOffset) Copies the value to the given bytebufferstatic Cell
createCell
(byte[] row) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] row, byte[] value) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] row, byte[] family, byte[] qualifier) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, byte[] tags, long memstoreTS) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, long memstoreTS) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] row, byte[] family, byte[] qualifier, long timestamp, KeyValue.Type type, byte[] value, byte[] tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(byte[] rowArray, int rowOffset, int rowLength, byte[] familyArray, int familyOffset, int familyLength, byte[] qualifierArray, int qualifierOffset, int qualifierLength) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(Cell cell, byte[] tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(Cell cell, byte[] value, byte[] tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static Cell
createCell
(Cell cell, List<Tag> tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellScanner
createCellScanner
(Iterable<Cell> cellIterable) Returns CellScanner interface overcellIterable
static CellScanner
createCellScanner
(Iterator<Cell> cells) Returns CellScanner interface overcellIterable
or null ifcells
is nullstatic CellScanner
createCellScanner
(List<? extends CellScannable> cellScannerables) Returns CellScanner interface overcellIterables
static CellScanner
createCellScanner
(NavigableMap<byte[], List<Cell>> map) Flatten the map of cells out under the CellScannerstatic CellScanner
createCellScanner
(Cell[] cellArray) Returns CellScanner interface overcellArray
static boolean
equalsstatic boolean
equalsIgnoreMvccVersion
(Cell a, Cell b) Deprecated.As of HBase-2.0.static long
estimatedHeapSizeOf
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static int
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static int
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static ByteRange
fillFamilyRange
(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRange
fillQualifierRange
(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRange
fillRowRange
(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRange
fillTagRange
(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRange
fillValueRange
(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static int
findCommonPrefixInFlatKey
(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) Deprecated.As of HBase-2.0.static String
getCellKeyAsString
(Cell cell) Return the key portion of the passedcell
as a String.static String
getCellKeyAsString
(Cell cell, Function<Cell, String> rowConverter) Return the Key portion of the passedcell
as a String.static byte[]
Deprecated.As of HBase-2.0.static ByteBuffer
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static byte
getRowByte
(Cell cell, int index) Deprecated.private static int
Return sum of the lengths of all the elements in a Cell; does not count in any infrastructureprivate static int
Return sum of all elements that make up a key; does not include infrastructure, tags or values.static Tag
Deprecated.As of 2.0.0 and will be removed in HBase-3.0.0 UseRawCell.getTag(byte)
static byte[]
getTagArray
(Cell cell) Deprecated.As of HBase-2.0.Deprecated.As of 2.0.0 and will be removed in 3.0.0static ByteBuffer
Deprecated.As of HBase-2.0.static boolean
isDelete
(byte type) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
Return true if a delete type, aKeyValue.Type.Delete
or a {KeyValue.Type#DeleteFamily} or aKeyValue.Type.DeleteColumn
KeyValue type.static boolean
isDeleteColumnOrFamily
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
isDeleteColumns
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
isDeleteColumnVersion
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
isDeleteFamily
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
isDeleteFamilyVersion
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
isDeleteType
(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
Returns True if this cell is a Put.static byte[]
makeColumn
(byte[] family, byte[] qualifier) Makes a column in family:qualifier form from separate byte arrays.static boolean
matchingColumn
(Cell left, byte[] fam, byte[] qual) static boolean
matchingColumn
(Cell left, byte[] fam, int foffset, int flength, byte[] qual, int qoffset, int qlength) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.private static boolean
matchingColumn
(Cell left, byte lFamLen, int lQualLength, Cell right, byte rFamLen, int rQualLength) static boolean
matchingColumn
(Cell left, Cell right) static boolean
matchingColumnFamilyAndQualifierPrefix
(Cell left, byte[] fam, byte[] qual) Returns True if matching column family and the qualifier starts withqual
static boolean
matchingFamily
(Cell left, byte[] buf) static boolean
matchingFamily
(Cell left, byte[] buf, int offset, int length) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
matchingFamily
(Cell left, byte lfamlength, Cell right, byte rfamlength) static boolean
matchingFamily
(Cell left, Cell right) static boolean
matchingQualifier
(Cell left, byte[] buf) Finds if the qualifier part of the cell and the KV serialized byte[] are equal.static boolean
matchingQualifier
(Cell left, byte[] buf, int offset, int length) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.private static boolean
matchingQualifier
(Cell left, int lqlength, Cell right, int rqlength) static boolean
matchingQualifier
(Cell left, Cell right) static boolean
matchingRow
(Cell left, byte[] buf) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
matchingRow
(Cell left, byte[] buf, int offset, int length) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
matchingRow
(Cell left, Cell right) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static boolean
matchingRowColumn
(Cell left, Cell right) Compares the row and column of two keyvalues for equalitystatic boolean
matchingRowColumnBytes
(Cell left, Cell right) Compares the row and column of two keyvalues for equalitystatic boolean
matchingRows
(Cell left, byte[] buf) static boolean
matchingRows
(Cell left, short lrowlength, Cell right, short rrowlength) Compares the row of two keyvalues for equalitystatic boolean
matchingRows
(Cell left, Cell right) Compares the row of two keyvalues for equalitystatic boolean
matchingTags
(Cell left, Cell right) static boolean
matchingTimestamp
(Cell a, Cell b) static boolean
matchingType
(Cell a, Cell b) Deprecated.As of HBase-2.0.static boolean
matchingValue
(Cell left, byte[] buf) static boolean
matchingValue
(Cell left, Cell right) static boolean
overlappingKeys
(byte[] start1, byte[] end1, byte[] start2, byte[] end2) Deprecated.As of 2.0.0 and will be removed in 3.0.0static byte[][]
parseColumn
(byte[] c) Splits a column infamily:qualifier
form into separate byte arrays.static void
setSequenceId
(Cell cell, long seqId) Deprecated.As of HBase-2.0.static void
setTimestamp
(Cell cell, byte[] ts, int tsOffset) Deprecated.As of HBase-2.0.static void
setTimestamp
(Cell cell, long ts) Deprecated.As of HBase-2.0.tagsIterator
(byte[] tags, int offset, int length) Deprecated.As of 2.0.0 and will be removed in 3.0.0 Instead usePrivateCellUtil.tagsIterator(Cell)
static String
Returns a string representation of the cellstatic boolean
updateLatestStamp
(Cell cell, byte[] ts, int tsOffset) Deprecated.As of HBase-2.0.static boolean
updateLatestStamp
(Cell cell, long ts) Deprecated.As of HBase-2.0.static void
writeFlatKey
(Cell cell, DataOutputStream out) Deprecated.As of HBase-2.0.static void
writeRowKeyExcludingCommon
(Cell cell, short rLen, int commonPrefix, DataOutputStream out) Deprecated.As of HBase-2.0.static void
writeRowSkippingBytes
(DataOutputStream out, Cell cell, short rlength, int commonPrefix) Deprecated.As of 2.0.
-
Constructor Details
-
CellUtil
private CellUtil()Private constructor to keep this class from being instantiated.
-
-
Method Details
-
fillRowRange
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0. -
fillFamilyRange
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0. -
fillQualifierRange
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0. -
fillValueRange
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0. -
fillTagRange
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0. -
cloneRow
get individual arrays for tests -
cloneFamily
-
cloneQualifier
-
cloneValue
-
cloneTags
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0. UseRawCell.cloneTags()
-
getTagArray
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Returns tag value in a new byte array. If server-side, useTag.getValueArray()
with appropriateTag.getValueOffset()
andTag.getValueLength()
instead to save on allocations.- Returns:
- tag value in a new byte array.
-
makeColumn
Makes a column in family:qualifier form from separate byte arrays.Not recommended for usage as this is old-style API.
- Returns:
- family:qualifier
-
parseColumn
Splits a column infamily:qualifier
form into separate byte arrays. An empty qualifier (ie,fam:
) is parsed as{ fam, EMPTY_BYTE_ARRAY }
while no delimiter (ie,fam
) is parsed as an array of one element,{ fam }
.Don't forget, HBase DOES support empty qualifiers. (see HBASE-9549)
Not recommend to be used as this is old-style API.
- Parameters:
c
- The column.- Returns:
- The parsed column.
-
copyRowTo
Copies the row to the given byte[]- Parameters:
cell
- the cell whose row has to be copieddestination
- the destination byte[] to which the row has to be copieddestinationOffset
- the offset in the destination byte[]- Returns:
- the offset of the byte[] after the copy has happened
-
copyRowTo
Copies the row to the given bytebuffer- Parameters:
cell
- cell the cell whose row has to be copieddestination
- the destination bytebuffer to which the row has to be copieddestinationOffset
- the offset in the destination byte[]- Returns:
- the offset of the bytebuffer after the copy has happened
-
copyRow
Copies the row to a new byte[]- Parameters:
cell
- the cell from which row has to copied- Returns:
- the byte[] containing the row
-
copyFamilyTo
Copies the family to the given byte[]- Parameters:
cell
- the cell whose family has to be copieddestination
- the destination byte[] to which the family has to be copieddestinationOffset
- the offset in the destination byte[]- Returns:
- the offset of the byte[] after the copy has happened
-
copyFamilyTo
Copies the family to the given bytebuffer- Parameters:
cell
- the cell whose family has to be copieddestination
- the destination bytebuffer to which the family has to be copieddestinationOffset
- the offset in the destination bytebuffer- Returns:
- the offset of the bytebuffer after the copy has happened
-
copyQualifierTo
Copies the qualifier to the given byte[]- Parameters:
cell
- the cell whose qualifier has to be copieddestination
- the destination byte[] to which the qualifier has to be copieddestinationOffset
- the offset in the destination byte[]- Returns:
- the offset of the byte[] after the copy has happened
-
copyQualifierTo
Copies the qualifier to the given bytebuffer- Parameters:
cell
- the cell whose qualifier has to be copieddestination
- the destination bytebuffer to which the qualifier has to be copieddestinationOffset
- the offset in the destination bytebuffer- Returns:
- the offset of the bytebuffer after the copy has happened
-
copyValueTo
Copies the value to the given byte[]- Parameters:
cell
- the cell whose value has to be copieddestination
- the destination byte[] to which the value has to be copieddestinationOffset
- the offset in the destination byte[]- Returns:
- the offset of the byte[] after the copy has happened
-
copyValueTo
Copies the value to the given bytebuffer- Parameters:
cell
- the cell whose value has to be copieddestination
- the destination bytebuffer to which the value has to be copieddestinationOffset
- the offset in the destination bytebuffer- Returns:
- the offset of the bytebuffer after the copy has happened
-
copyTagTo
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0.Copies the tags info into the tag portion of the cell- Returns:
- position after tags
-
copyTagTo
Deprecated.As of HBase-2.0. Will be removed in 3.0.Copies the tags info into the tag portion of the cell- Returns:
- position after tags
-
getRowByte
Deprecated.misc -
getValueBufferShallowCopy
Deprecated.As of HBase-2.0. Will be removed in 3.0. -
getQualifierBufferShallowCopy
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Return cell's qualifier wrapped into a ByteBuffer. -
createCell
@Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseCellBuilder
insteadCreate a cell -
createCell
@Deprecated public static Cell createCell(byte[] rowArray, int rowOffset, int rowLength, byte[] familyArray, int familyOffset, int familyLength, byte[] qualifierArray, int qualifierOffset, int qualifierLength) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseCellBuilder
insteadCreates a cell with deep copy of all passed bytes. -
createCell
@Private @Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, long memstoreTS) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseExtendedCellBuilder
insteadMarked as audience Private as of 1.2.0. Creating a Cell with a memstoreTS/mvcc is an internal implementation detail not for public use. -
createCell
@Private @Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, byte[] tags, long memstoreTS) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseExtendedCellBuilder
insteadMarked as audience Private as of 1.2.0. Creating a Cell with tags and a memstoreTS/mvcc is an internal implementation detail not for public use. -
createCell
@Private @Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, KeyValue.Type type, byte[] value, byte[] tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseExtendedCellBuilder
insteadMarked as audience Private as of 1.2.0. Creating a Cell with tags is an internal implementation detail not for public use. -
createCell
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseCellBuilder
insteadCreate a Cell with specific row. Other fields defaulted.- Returns:
- Cell with passed row but all other fields are arbitrary
-
createCell
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseCellBuilder
insteadCreate a Cell with specific row and value. Other fields are defaulted.- Returns:
- Cell with passed row and value but all other fields are arbitrary
-
createCell
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseCellBuilder
insteadCreate a Cell with specific row. Other fields defaulted.- Returns:
- Cell with passed row but all other fields are arbitrary
-
createCell
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Note : Now only CPs can create cell with tags using the CP environment Within CP, useRawCell.createCell(Cell, List)
method instead- Returns:
- A new cell which is having the extra tags also added to it.
-
createCell
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Now only CPs can create cell with tags using the CP environment Within CP, useRawCell.createCell(Cell, List)
method instead- Returns:
- A new cell which is having the extra tags also added to it.
-
createCell
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Now only CPs can create cell with tags using the CP environment Within CP, useRawCell.createCell(Cell, List)
method instead -
createCellScanner
Returns CellScanner interface overcellIterables
-
createCellScanner
Returns CellScanner interface overcellIterable
-
createCellScanner
Returns CellScanner interface overcellIterable
or null ifcells
is null -
createCellScanner
Returns CellScanner interface overcellArray
-
matchingRow
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. Instead usematchingRows(Cell, Cell)
Return true if the rows inleft
andright
Cells match -
matchingRow
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. Instead usematchingRows(Cell, byte[])
Return true if the row is matching -
matchingRows
-
matchingRow
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. Instead usematchingRows(Cell, Cell)
Return true if the row is matching -
matchingFamily
-
matchingFamily
-
matchingFamily
-
matchingFamily
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Return true if the family is matching -
matchingQualifier
-
matchingQualifier
-
matchingQualifier
Finds if the qualifier part of the cell and the KV serialized byte[] are equal.- Returns:
- true if the qualifier matches, false otherwise
-
matchingQualifier
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Finds if the qualifier part of the cell and the KV serialized byte[] are equal- Parameters:
buf
- the serialized keyvalue format byte[]offset
- the offset of the qualifier in the byte[]length
- the length of the qualifier in the byte[]- Returns:
- true if the qualifier matches, false otherwise
-
matchingColumn
-
matchingColumnFamilyAndQualifierPrefix
Returns True if matching column family and the qualifier starts withqual
-
matchingColumn
@Deprecated public static boolean matchingColumn(Cell left, byte[] fam, int foffset, int flength, byte[] qual, int qoffset, int qlength) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Return true if the column is matching -
matchingColumn
-
matchingColumn
private static boolean matchingColumn(Cell left, byte lFamLen, int lQualLength, Cell right, byte rFamLen, int rQualLength) -
matchingValue
-
matchingValue
-
matchingTags
-
isDelete
Return true if a delete type, aKeyValue.Type.Delete
or a {KeyValue.Type#DeleteFamily} or aKeyValue.Type.DeleteColumn
KeyValue type. -
isDelete
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Return true if a delete type, aKeyValue.Type.Delete
or a {KeyValue.Type#DeleteFamily} or aKeyValue.Type.DeleteColumn
KeyValue type. -
isDeleteType
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Return true if this cell is aKeyValue.Type.Delete
type. -
isDeleteFamily
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Check whether the given cell is a delete family -
isDeleteFamilyVersion
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Check whether the given cell is a delete family version -
isDeleteColumns
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Check whether the given cell is a delete columns -
isDeleteColumnVersion
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Check whether the given cell is a delete column version -
isDeleteColumnOrFamily
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Return true if this cell is a delete family or column type. -
isPut
Returns True if this cell is a Put. -
estimatedSerializedSizeOf
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Estimate based on keyvalue's serialization format in the RPC layer. Note that there is an extra SIZEOF_INT added to the size here that indicates the actual length of the cell for cases where cell's are serialized in a contiguous format (For eg in RPCs).- Returns:
- Estimate of the
cell
size in bytes plus an extra SIZEOF_INT indicating the actual cell length.
-
getSumOfCellElementLengths
Return sum of the lengths of all the elements in a Cell; does not count in any infrastructure -
getSumOfCellKeyElementLengths
Return sum of all elements that make up a key; does not include infrastructure, tags or values. -
estimatedSerializedSizeOfKey
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.Calculates the serialized key size. We always serialize in the KeyValue's serialization format.- Parameters:
cell
- the cell for which the key size has to be calculated.- Returns:
- the key size
-
estimatedHeapSizeOf
Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. UseRawCell.getTags()
This is an estimate of the heap space occupied by a cell. When the cell is of typeHeapSize
we callHeapSize.heapSize()
so cell can give a correct value. In other cases we just consider the bytes occupied by the cell components ie. row, CF, qualifier, timestamp, type, value and tags.- Returns:
- estimate of the heap space
-
tagsIterator
Deprecated.As of 2.0.0 and will be removed in 3.0.0 Instead usePrivateCellUtil.tagsIterator(Cell)
Util method to iterate through the tags- Returns:
- iterator for the tags
-
getTags
Deprecated.As of 2.0.0 and will be removed in 3.0.0Return tags in the given Cell as a List -
getTag
Deprecated.As of 2.0.0 and will be removed in HBase-3.0.0 UseRawCell.getTag(byte)
Retrieve Cell's first tag, matching the passed in type- Parameters:
cell
- The Celltype
- Type of the Tag to retrieve- Returns:
- null if there is no tag of the passed in tag type
-
overlappingKeys
@Deprecated public static boolean overlappingKeys(byte[] start1, byte[] end1, byte[] start2, byte[] end2) Deprecated.As of 2.0.0 and will be removed in 3.0.0Returns true if the first range start1...end1 overlaps with the second range start2...end2, assuming the byte arrays represent row keys -
setSequenceId
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Sets the given seqId to the cell. Marked as audience Private as of 1.2.0. Setting a Cell sequenceid is an internal implementation detail not for general public use.- Throws:
IOException
- when the passed cell is not of typeExtendedCell
-
setTimestamp
Deprecated.As of HBase-2.0. Will be a LimitedPrivate API in HBase-3.0.Sets the given timestamp to the cell. Note that this method is a LimitedPrivate API and may change between minor releases.- Throws:
IOException
- when the passed cell is not of typeExtendedCell
-
setTimestamp
Deprecated.As of HBase-2.0. Will be a LimitedPrivate API in HBase-3.0.Sets the given timestamp to the cell. Note that this method is a LimitedPrivate API and may change between minor releases.- Throws:
IOException
- when the passed cell is not of typeExtendedCell
-
updateLatestStamp
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Sets the given timestamp to the cell iff current timestamp isHConstants.LATEST_TIMESTAMP
.- Returns:
- True if cell timestamp is modified.
- Throws:
IOException
- when the passed cell is not of typeExtendedCell
-
updateLatestStamp
@Deprecated public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Sets the given timestamp to the cell iff current timestamp isHConstants.LATEST_TIMESTAMP
.- Parameters:
ts
- buffer containing the timestamp valuetsOffset
- offset to the new timestamp- Returns:
- True if cell timestamp is modified.
- Throws:
IOException
- when the passed cell is not of typeExtendedCell
-
writeFlatKey
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Writes the Cell's key part as it would have serialized in a KeyValue. The format is <2 bytes rk len><rk><1 byte cf len><cf><qualifier><8 bytes timestamp><1 byte type>- Throws:
IOException
-
writeRowSkippingBytes
@Deprecated public static void writeRowSkippingBytes(DataOutputStream out, Cell cell, short rlength, int commonPrefix) throws IOException Deprecated.As of 2.0. Will be removed in hbase-3.0Writes the row from the given cell to the output stream excluding the common prefix- Parameters:
out
- The dataoutputstream to which the data has to be writtencell
- The cell whose contents has to be writtenrlength
- the row length- Throws:
IOException
-
getCellKeyAsString
Return the key portion of the passedcell
as a String. -
getCellKeyAsString
Return the Key portion of the passedcell
as a String.- Parameters:
cell
- the cell to convertrowConverter
- used to convert the row of the cell to a string- Returns:
- The Key portion of the passed
cell
as a String.
-
getCellKeySerializedAsKeyValueKey
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0This method exists just to encapsulate how we serialize keys. To be replaced by a factory that we query to figure what the Cell implementation is and then, what serialization engine to use and further, how to serialize the key for inclusion in hfile index. TODO.- Returns:
- The key portion of the Cell serialized in the old-school KeyValue way or null if passed
a null
cell
-
writeRowKeyExcludingCommon
@Deprecated public static void writeRowKeyExcludingCommon(Cell cell, short rLen, int commonPrefix, DataOutputStream out) throws IOException Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Write rowkey excluding the common part.- Throws:
IOException
-
findCommonPrefixInFlatKey
@Deprecated public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Find length of common prefix in keys of the cells, considering key as byte[] if serialized inKeyValue
. The key format is <2 bytes rk len><rk><1 byte cf len><cf><qualifier><8 bytes timestamp><1 byte type>- Parameters:
c1
- the cellc2
- the cellbypassFamilyCheck
- when true assume the family bytes same in both cells. Pass it as true when dealing with Cells in same CF so as to avoid some checkswithTsType
- when true check timestamp and type bytes also.- Returns:
- length of common prefix
-
toString
Returns a string representation of the cell -
equalsIgnoreMvccVersion
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0special case for Cell.equals -
equals
equals -
matchingTimestamp
-
matchingType
Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Check whether the type of these two cells are the same -
matchingRows
Compares the row of two keyvalues for equality -
matchingRows
Compares the row of two keyvalues for equality -
matchingRowColumn
Compares the row and column of two keyvalues for equality -
matchingRowColumnBytes
Compares the row and column of two keyvalues for equality -
compareQualifiers
Compares the cell's qualifier with the given byte[]- Parameters:
left
- the cell for which the qualifier has to be comparedright
- the byte[] having the qualifierrOffset
- the offset of the qualifierrLength
- the length of the qualifier- Returns:
- greater than 0 if left cell's qualifier is bigger than byte[], lesser than 0 if left cell's qualifier is lesser than byte[] and 0 otherwise
-
compare
@Private @Deprecated public static final int compare(CellComparator comparator, Cell left, byte[] key, int offset, int length) Deprecated.As of HBase-2.0. Will be removed in HBase-3.0Used when a cell needs to be compared with a key byte[] such as cases of finding the index from the index block, bloom keys from the bloom blocks This byte[] is expected to be serialized in the KeyValue serialization format If the KeyValue (Cell's) serialization format changes this method cannot be used.- Parameters:
comparator
- the cell comparatorleft
- the cell to be comparedkey
- the serialized key part of a KeyValueoffset
- the offset in the key byte[]length
- the length of the key byte[]- Returns:
- an int greater than 0 if left is greater than right lesser than 0 if left is lesser than right equal to 0 if left is equal to right
-
compareFamilies
Compares the cell's family with the given byte[]- Parameters:
left
- the cell for which the family has to be comparedright
- the byte[] having the familyroffset
- the offset of the familyrlength
- the length of the family- Returns:
- greater than 0 if left cell's family is bigger than byte[], lesser than 0 if left cell's family is lesser than byte[] and 0 otherwise
-
compareColumns
public static final int compareColumns(Cell left, byte[] right, int rfoffset, int rflength, int rqoffset, int rqlength) Compares the cell's column (family and qualifier) with the given byte[]- Parameters:
left
- the cell for which the column has to be comparedright
- the byte[] having the columnrfoffset
- the offset of the familyrflength
- the length of the familyrqoffset
- the offset of the qualifierrqlength
- the length of the qualifier- Returns:
- greater than 0 if left cell's column is bigger than byte[], lesser than 0 if left cell's column is lesser than byte[] and 0 otherwise
-
cloneIfNecessary
-
cloneIfNecessary
-