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
ConstructorsModifierConstructorDescriptionprivateCellUtil()Private constructor to keep this class from being instantiated. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]cloneFamily(Cell cell) static voidcloneIfNecessary(ArrayList<Cell> cells) static CellcloneIfNecessary(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 intcompare(CellComparator comparator, Cell left, byte[] key, int offset, int length) Deprecated.As of HBase-2.0.static final intcompareColumns(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 intcompareFamilies(Cell left, byte[] right, int roffset, int rlength) Compares the cell's family with the given byte[]static final intcompareQualifiers(Cell left, byte[] right, int rOffset, int rLength) Compares the cell's qualifier with the given byte[]static intcopyFamilyTo(Cell cell, byte[] destination, int destinationOffset) Copies the family to the given byte[]static intcopyFamilyTo(Cell cell, ByteBuffer destination, int destinationOffset) Copies the family to the given bytebufferstatic intcopyQualifierTo(Cell cell, byte[] destination, int destinationOffset) Copies the qualifier to the given byte[]static intcopyQualifierTo(Cell cell, ByteBuffer destination, int destinationOffset) Copies the qualifier to the given bytebufferstatic byte[]Copies the row to a new byte[]static intCopies the row to the given byte[]static intcopyRowTo(Cell cell, ByteBuffer destination, int destinationOffset) Copies the row to the given bytebufferstatic intDeprecated.As of HBase-2.0.static intcopyTagTo(Cell cell, ByteBuffer destination, int destinationOffset) Deprecated.As of HBase-2.0.static intcopyValueTo(Cell cell, byte[] destination, int destinationOffset) Copies the value to the given byte[]static intcopyValueTo(Cell cell, ByteBuffer destination, int destinationOffset) Copies the value to the given bytebufferstatic CellcreateCell(byte[] row) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellcreateCell(byte[] row, byte[] value) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellcreateCell(byte[] row, byte[] family, byte[] qualifier) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellcreateCell(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 CellcreateCell(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 CellcreateCell(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 CellcreateCell(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 CellcreateCell(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 CellcreateCell(Cell cell, byte[] tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellcreateCell(Cell cell, byte[] value, byte[] tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellcreateCell(Cell cell, List<Tag> tags) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static CellScannercreateCellScanner(Iterable<Cell> cellIterable) Returns CellScanner interface overcellIterablestatic CellScannercreateCellScanner(Iterator<Cell> cells) Returns CellScanner interface overcellIterableor null ifcellsis nullstatic CellScannercreateCellScanner(List<? extends CellScannable> cellScannerables) Returns CellScanner interface overcellIterablesstatic CellScannercreateCellScanner(NavigableMap<byte[], List<Cell>> map) Flatten the map of cells out under the CellScannerstatic CellScannercreateCellScanner(Cell[] cellArray) Returns CellScanner interface overcellArraystatic booleanequalsstatic booleanequalsIgnoreMvccVersion(Cell a, Cell b) Deprecated.As of HBase-2.0.static longestimatedHeapSizeOf(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static intDeprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static intDeprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static ByteRangefillFamilyRange(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRangefillQualifierRange(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRangefillRowRange(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRangefillTagRange(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static ByteRangefillValueRange(Cell cell, ByteRange range) Deprecated.As of HBase-2.0.static intfindCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType) Deprecated.As of HBase-2.0.static StringgetCellKeyAsString(Cell cell) Return the key portion of the passedcellas a String.static StringgetCellKeyAsString(Cell cell, Function<Cell, String> rowConverter) Return the Key portion of the passedcellas a String.static byte[]Deprecated.As of HBase-2.0.static ByteBufferDeprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static bytegetRowByte(Cell cell, int index) Deprecated.private static intReturn sum of the lengths of all the elements in a Cell; does not count in any infrastructureprivate static intReturn sum of all elements that make up a key; does not include infrastructure, tags or values.static TagDeprecated.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 ByteBufferDeprecated.As of HBase-2.0.static booleanisDelete(byte type) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanReturn true if a delete type, aKeyValue.Type.Deleteor a {KeyValue.Type#DeleteFamily} or aKeyValue.Type.DeleteColumnKeyValue type.static booleanisDeleteColumnOrFamily(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanisDeleteColumns(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanisDeleteColumnVersion(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanisDeleteFamily(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanisDeleteFamilyVersion(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanisDeleteType(Cell cell) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanReturns 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 booleanmatchingColumn(Cell left, byte[] fam, byte[] qual) static booleanmatchingColumn(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 booleanmatchingColumn(Cell left, byte lFamLen, int lQualLength, Cell right, byte rFamLen, int rQualLength) static booleanmatchingColumn(Cell left, Cell right) static booleanmatchingColumnFamilyAndQualifierPrefix(Cell left, byte[] fam, byte[] qual) Returns True if matching column family and the qualifier starts withqualstatic booleanmatchingFamily(Cell left, byte[] buf) static booleanmatchingFamily(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 booleanmatchingFamily(Cell left, byte lfamlength, Cell right, byte rfamlength) static booleanmatchingFamily(Cell left, Cell right) static booleanmatchingQualifier(Cell left, byte[] buf) Finds if the qualifier part of the cell and the KV serialized byte[] are equal.static booleanmatchingQualifier(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 booleanmatchingQualifier(Cell left, int lqlength, Cell right, int rqlength) static booleanmatchingQualifier(Cell left, Cell right) static booleanmatchingRow(Cell left, byte[] buf) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanmatchingRow(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 booleanmatchingRow(Cell left, Cell right) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.static booleanmatchingRowColumn(Cell left, Cell right) Compares the row and column of two keyvalues for equalitystatic booleanmatchingRowColumnBytes(Cell left, Cell right) Compares the row and column of two keyvalues for equalitystatic booleanmatchingRows(Cell left, byte[] buf) static booleanmatchingRows(Cell left, short lrowlength, Cell right, short rrowlength) Compares the row of two keyvalues for equalitystatic booleanmatchingRows(Cell left, Cell right) Compares the row of two keyvalues for equalitystatic booleanmatchingTags(Cell left, Cell right) static booleanmatchingTimestamp(Cell a, Cell b) static booleanmatchingType(Cell a, Cell b) Deprecated.As of HBase-2.0.static booleanmatchingValue(Cell left, byte[] buf) static booleanmatchingValue(Cell left, Cell right) static booleanoverlappingKeys(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:qualifierform into separate byte arrays.static voidsetSequenceId(Cell cell, long seqId) Deprecated.As of HBase-2.0.static voidsetTimestamp(Cell cell, byte[] ts, int tsOffset) Deprecated.As of HBase-2.0.static voidsetTimestamp(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 StringReturns a string representation of the cellstatic booleanupdateLatestStamp(Cell cell, byte[] ts, int tsOffset) Deprecated.As of HBase-2.0.static booleanupdateLatestStamp(Cell cell, long ts) Deprecated.As of HBase-2.0.static voidwriteFlatKey(Cell cell, DataOutputStream out) Deprecated.As of HBase-2.0.static voidwriteRowKeyExcludingCommon(Cell cell, short rLen, int commonPrefix, DataOutputStream out) Deprecated.As of HBase-2.0.static voidwriteRowSkippingBytes(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:qualifierform 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. UseCellBuilderinsteadCreate 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. UseCellBuilderinsteadCreates 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. UseExtendedCellBuilderinsteadMarked 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. UseExtendedCellBuilderinsteadMarked 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. UseExtendedCellBuilderinsteadMarked 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. UseCellBuilderinsteadCreate 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. UseCellBuilderinsteadCreate 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. UseCellBuilderinsteadCreate 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 overcellIterableor null ifcellsis 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 inleftandrightCells 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.Deleteor a {KeyValue.Type#DeleteFamily} or aKeyValue.Type.DeleteColumnKeyValue 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.Deleteor a {KeyValue.Type#DeleteFamily} or aKeyValue.Type.DeleteColumnKeyValue 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.Deletetype. -
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
cellsize 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 typeHeapSizewe 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 passedcellas a String. -
getCellKeyAsString
Return the Key portion of the passedcellas 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
cellas 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
-