@InterfaceAudience.Public public final class CellUtil extends Object
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.0Modifier | Constructor and Description |
---|---|
private |
CellUtil()
Private constructor to keep this class from being instantiated.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
cloneFamily(Cell cell) |
static void |
cloneIfNecessary(ArrayList<Cell> cells) |
static Cell |
cloneIfNecessary(Cell cell) |
static byte[] |
cloneQualifier(Cell cell) |
static byte[] |
cloneRow(Cell cell)
get individual arrays for tests
|
static byte[] |
cloneTags(Cell cell)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0. Use
RawCell.cloneTags() |
static byte[] |
cloneValue(Cell cell) |
static int |
compare(CellComparator comparator,
Cell left,
byte[] key,
int offset,
int length)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static 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 int |
compareFamilies(Cell left,
byte[] right,
int roffset,
int rlength)
Compares the cell's family with the given byte[]
|
static 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 bytebuffer
|
static 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 bytebuffer
|
static byte[] |
copyRow(Cell cell)
Copies the row to a new byte[]
|
static int |
copyRowTo(Cell cell,
byte[] destination,
int destinationOffset)
Copies the row to the given byte[]
|
static int |
copyRowTo(Cell cell,
ByteBuffer destination,
int destinationOffset)
Copies the row to the given bytebuffer
|
static int |
copyTagTo(Cell cell,
byte[] destination,
int destinationOffset)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0.
|
static int |
copyTagTo(Cell cell,
ByteBuffer destination,
int destinationOffset)
Deprecated.
As of HBase-2.0. Will be removed in 3.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 bytebuffer
|
static Cell |
createCell(byte[] row)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. Use
CellBuilder
instead |
static Cell |
createCell(byte[] row,
byte[] value)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. Use
CellBuilder
instead |
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. Use
CellBuilder
instead |
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. Use
CellBuilder
instead |
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. Use
ExtendedCellBuilder instead |
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. Use
ExtendedCellBuilder instead |
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. Use
ExtendedCellBuilder instead |
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. Use
CellBuilder
instead |
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(Cell[] cellArray)
Return CellScanner interface over
cellArray |
static CellScanner |
createCellScanner(Iterable<Cell> cellIterable)
Return CellScanner interface over
cellIterable |
static CellScanner |
createCellScanner(Iterator<Cell> cells)
Return CellScanner interface over
cellIterable or null if cells is
null |
static CellScanner |
createCellScanner(List<? extends CellScannable> cellScannerables)
Return CellScanner interface over
cellIterables |
static CellScanner |
createCellScanner(NavigableMap<byte[],List<Cell>> map)
Flatten the map of cells out under the CellScanner
|
static boolean |
equals(Cell a,
Cell b)
equals
|
static boolean |
equalsIgnoreMvccVersion(Cell a,
Cell b)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static long |
estimatedHeapSizeOf(Cell cell)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. Use
RawCell.getTags() |
static int |
estimatedSerializedSizeOf(Cell cell)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
|
static int |
estimatedSerializedSizeOfKey(Cell cell)
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. Will be removed in HBase-3.0.
|
static ByteRange |
fillQualifierRange(Cell cell,
ByteRange range)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0.
|
static ByteRange |
fillRowRange(Cell cell,
ByteRange range)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0.
|
static ByteRange |
fillTagRange(Cell cell,
ByteRange range)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0.
|
static ByteRange |
fillValueRange(Cell cell,
ByteRange range)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0.
|
static int |
findCommonPrefixInFlatKey(Cell c1,
Cell c2,
boolean bypassFamilyCheck,
boolean withTsType)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static String |
getCellKeyAsString(Cell cell)
Return the key portion of the passed
cell as a String. |
static String |
getCellKeyAsString(Cell cell,
Function<Cell,String> rowConverter)
Return the Key portion of the passed
cell as a String. |
static byte[] |
getCellKeySerializedAsKeyValueKey(Cell cell)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static ByteBuffer |
getQualifierBufferShallowCopy(Cell cell)
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 |
getSumOfCellElementLengths(Cell cell)
Return sum of the lengths of all the elements in a Cell; does not count in any infrastructure
|
private static int |
getSumOfCellKeyElementLengths(Cell cell)
Return sum of all elements that make up a key; does not include infrastructure, tags or values.
|
static Tag |
getTag(Cell cell,
byte type)
Deprecated.
As of 2.0.0 and will be removed in HBase-3.0.0 Use
RawCell.getTag(byte) |
static byte[] |
getTagArray(Cell cell)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static List<Tag> |
getTags(Cell cell)
Deprecated.
As of 2.0.0 and will be removed in 3.0.0
|
static ByteBuffer |
getValueBufferShallowCopy(Cell cell)
Deprecated.
As of HBase-2.0. Will be removed in 3.0.
|
static boolean |
isDelete(byte type)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
|
static boolean |
isDelete(Cell cell)
Return true if a delete type, a
KeyValue.Type.Delete or a {KeyValue.Type#DeleteFamily}
or a KeyValue.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 |
isPut(Cell cell)
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 with
qual |
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.
|
static boolean |
matchingQualifier(Cell left,
Cell right) |
private static boolean |
matchingQualifier(Cell left,
int lqlength,
Cell right,
int rqlength) |
static boolean |
matchingRow(Cell left,
byte[] buf)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. Instead use
matchingRows(Cell, byte[]) |
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. Instead use
matchingRows(Cell, Cell) |
static boolean |
matchingRow(Cell left,
Cell right)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. Instead use
matchingRows(Cell, Cell) |
static boolean |
matchingRowColumn(Cell left,
Cell right)
Compares the row and column of two keyvalues for equality
|
static boolean |
matchingRowColumnBytes(Cell left,
Cell right)
Compares the row and column of two keyvalues for equality
|
static boolean |
matchingRows(Cell left,
byte[] buf) |
static boolean |
matchingRows(Cell left,
Cell right)
Compares the row of two keyvalues for equality
|
static boolean |
matchingRows(Cell left,
short lrowlength,
Cell right,
short rrowlength)
Compares the row of two keyvalues for equality
|
static 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. Will be removed in HBase-3.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.0
|
static byte[][] |
parseColumn(byte[] c)
Splits a column in
family:qualifier form into separate byte arrays. |
static void |
setSequenceId(Cell cell,
long seqId)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static void |
setTimestamp(Cell cell,
byte[] ts,
int tsOffset)
Deprecated.
As of HBase-2.0. Will be a LimitedPrivate API in HBase-3.0.
|
static void |
setTimestamp(Cell cell,
long ts)
Deprecated.
As of HBase-2.0. Will be a LimitedPrivate API in HBase-3.0.
|
static Iterator<Tag> |
tagsIterator(byte[] tags,
int offset,
int length)
Deprecated.
As of 2.0.0 and will be removed in 3.0.0 Instead use
PrivateCellUtil.tagsIterator(Cell) |
static String |
toString(Cell cell,
boolean verbose)
Returns a string representation of the cell
|
static boolean |
updateLatestStamp(Cell cell,
byte[] ts,
int tsOffset)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static boolean |
updateLatestStamp(Cell cell,
long ts)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static void |
writeFlatKey(Cell cell,
DataOutputStream out)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static void |
writeRowKeyExcludingCommon(Cell cell,
short rLen,
int commonPrefix,
DataOutputStream out)
Deprecated.
As of HBase-2.0. Will be removed in HBase-3.0
|
static void |
writeRowSkippingBytes(DataOutputStream out,
Cell cell,
short rlength,
int commonPrefix)
Deprecated.
As of 2.0. Will be removed in hbase-3.0
|
private CellUtil()
@Deprecated public static ByteRange fillRowRange(Cell cell, ByteRange range)
@Deprecated public static ByteRange fillFamilyRange(Cell cell, ByteRange range)
@Deprecated public static ByteRange fillQualifierRange(Cell cell, ByteRange range)
@Deprecated public static ByteRange fillValueRange(Cell cell, ByteRange range)
@Deprecated public static ByteRange fillTagRange(Cell cell, ByteRange range)
public static byte[] cloneFamily(Cell cell)
public static byte[] cloneQualifier(Cell cell)
public static byte[] cloneValue(Cell cell)
@Deprecated public static byte[] cloneTags(Cell cell)
RawCell.cloneTags()
@Deprecated public static byte[] getTagArray(Cell cell)
Tag.getValueArray()
with
appropriate Tag.getValueOffset()
and Tag.getValueLength()
instead to save on
allocations.public static byte[] makeColumn(byte[] family, byte[] qualifier)
Not recommended for usage as this is old-style API.
public static byte[][] parseColumn(byte[] c)
family: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.
c
- The column.public static int copyRowTo(Cell cell, byte[] destination, int destinationOffset)
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[]public static int copyRowTo(Cell cell, ByteBuffer destination, int destinationOffset)
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[]public static byte[] copyRow(Cell cell)
cell
- the cell from which row has to copiedpublic static int copyFamilyTo(Cell cell, byte[] destination, int destinationOffset)
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[]public static int copyFamilyTo(Cell cell, ByteBuffer destination, int destinationOffset)
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 bytebufferpublic static int copyQualifierTo(Cell cell, byte[] destination, int destinationOffset)
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[]public static int copyQualifierTo(Cell cell, ByteBuffer destination, int destinationOffset)
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 bytebufferpublic static int copyValueTo(Cell cell, byte[] destination, int destinationOffset)
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[]public static int copyValueTo(Cell cell, ByteBuffer destination, int destinationOffset)
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@Deprecated public static int copyTagTo(Cell cell, byte[] destination, int destinationOffset)
@Deprecated public static int copyTagTo(Cell cell, ByteBuffer destination, int destinationOffset)
@InterfaceAudience.Private @Deprecated public static byte getRowByte(Cell cell, int index)
@Deprecated public static ByteBuffer getValueBufferShallowCopy(Cell cell)
@Deprecated public static ByteBuffer getQualifierBufferShallowCopy(Cell cell)
@Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value)
CellBuilder
instead@Deprecated public static Cell createCell(byte[] rowArray, int rowOffset, int rowLength, byte[] familyArray, int familyOffset, int familyLength, byte[] qualifierArray, int qualifierOffset, int qualifierLength)
CellBuilder
instead@InterfaceAudience.Private @Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, long memstoreTS)
ExtendedCellBuilder
instead@InterfaceAudience.Private @Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, byte[] tags, long memstoreTS)
ExtendedCellBuilder
instead@InterfaceAudience.Private @Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, KeyValue.Type type, byte[] value, byte[] tags)
ExtendedCellBuilder
instead@Deprecated public static Cell createCell(byte[] row)
CellBuilder
instead@Deprecated public static Cell createCell(byte[] row, byte[] value)
CellBuilder
instead@Deprecated public static Cell createCell(byte[] row, byte[] family, byte[] qualifier)
CellBuilder
instead@Deprecated public static Cell createCell(Cell cell, List<Tag> tags)
RawCell.createCell(Cell, List)
method instead@Deprecated public static Cell createCell(Cell cell, byte[] tags)
RawCell.createCell(Cell, List)
method instead@Deprecated public static Cell createCell(Cell cell, byte[] value, byte[] tags)
RawCell.createCell(Cell, List)
method insteadpublic static CellScanner createCellScanner(List<? extends CellScannable> cellScannerables)
cellIterables
public static CellScanner createCellScanner(Iterable<Cell> cellIterable)
cellIterable
public static CellScanner createCellScanner(Iterator<Cell> cells)
cellIterable
or null if cells
is
nullpublic static CellScanner createCellScanner(Cell[] cellArray)
cellArray
public static CellScanner createCellScanner(NavigableMap<byte[],List<Cell>> map)
map
- Map of Cell Lists; for example, the map of families to Cells that is used inside
Put, etc., keeping Cells organized by family.cellIterable
@Deprecated public static boolean matchingRow(Cell left, Cell right)
matchingRows(Cell, Cell)
left
and right
Cells match@Deprecated public static boolean matchingRow(Cell left, byte[] buf)
matchingRows(Cell, byte[])
public static boolean matchingRows(Cell left, byte[] buf)
@Deprecated public static boolean matchingRow(Cell left, byte[] buf, int offset, int length)
matchingRows(Cell, Cell)
public static boolean matchingFamily(Cell left, Cell right)
public static boolean matchingFamily(Cell left, byte lfamlength, Cell right, byte rfamlength)
public static boolean matchingFamily(Cell left, byte[] buf)
@Deprecated public static boolean matchingFamily(Cell left, byte[] buf, int offset, int length)
public static boolean matchingQualifier(Cell left, Cell right)
private static boolean matchingQualifier(Cell left, int lqlength, Cell right, int rqlength)
public static boolean matchingQualifier(Cell left, byte[] buf)
@Deprecated public static boolean matchingQualifier(Cell left, byte[] buf, int offset, int length)
buf
- the serialized keyvalue format byte[]offset
- the offset of the qualifier in the byte[]length
- the length of the qualifier in the byte[]public static boolean matchingColumn(Cell left, byte[] fam, byte[] qual)
public static boolean matchingColumnFamilyAndQualifierPrefix(Cell left, byte[] fam, byte[] qual)
qual
@Deprecated public static boolean matchingColumn(Cell left, byte[] fam, int foffset, int flength, byte[] qual, int qoffset, int qlength)
public static boolean matchingColumn(Cell left, Cell right)
private static boolean matchingColumn(Cell left, byte lFamLen, int lQualLength, Cell right, byte rFamLen, int rQualLength)
public static boolean matchingValue(Cell left, Cell right)
public static boolean matchingValue(Cell left, byte[] buf)
public static boolean matchingTags(Cell left, Cell right)
public static boolean isDelete(Cell cell)
KeyValue.Type.Delete
or a {KeyValue.Type#DeleteFamily}
or a KeyValue.Type.DeleteColumn
KeyValue type.@Deprecated public static boolean isDelete(byte type)
KeyValue.Type.Delete
or a {KeyValue.Type#DeleteFamily}
or a KeyValue.Type.DeleteColumn
KeyValue type.@Deprecated public static boolean isDeleteType(Cell cell)
KeyValue.Type.Delete
type.@Deprecated public static boolean isDeleteFamily(Cell cell)
@Deprecated public static boolean isDeleteFamilyVersion(Cell cell)
@Deprecated public static boolean isDeleteColumns(Cell cell)
@Deprecated public static boolean isDeleteColumnVersion(Cell cell)
@Deprecated public static boolean isDeleteColumnOrFamily(Cell cell)
@Deprecated public static int estimatedSerializedSizeOf(Cell cell)
cell
size in bytes plus an extra SIZEOF_INT indicating the
actual cell length.private static int getSumOfCellElementLengths(Cell cell)
private static int getSumOfCellKeyElementLengths(Cell cell)
@Deprecated public static int estimatedSerializedSizeOfKey(Cell cell)
cell
- the cell for which the key size has to be calculated.@Deprecated public static long estimatedHeapSizeOf(Cell cell)
RawCell.getTags()
HeapSize
we call HeapSize.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.@Deprecated public static Iterator<Tag> tagsIterator(byte[] tags, int offset, int length)
PrivateCellUtil.tagsIterator(Cell)
@Deprecated public static List<Tag> getTags(Cell cell)
@Deprecated public static Tag getTag(Cell cell, byte type)
RawCell.getTag(byte)
cell
- The Celltype
- Type of the Tag to retrieve@Deprecated public static boolean overlappingKeys(byte[] start1, byte[] end1, byte[] start2, byte[] end2)
@Deprecated public static void setSequenceId(Cell cell, long seqId) throws IOException
IOException
- when the passed cell is not of type ExtendedCell
@Deprecated public static void setTimestamp(Cell cell, long ts) throws IOException
IOException
- when the passed cell is not of type ExtendedCell
@Deprecated public static void setTimestamp(Cell cell, byte[] ts, int tsOffset) throws IOException
IOException
- when the passed cell is not of type ExtendedCell
@Deprecated public static boolean updateLatestStamp(Cell cell, long ts) throws IOException
HConstants.LATEST_TIMESTAMP
.IOException
- when the passed cell is not of type ExtendedCell
@Deprecated public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException
HConstants.LATEST_TIMESTAMP
.ts
- buffer containing the timestamp valuetsOffset
- offset to the new timestampIOException
- when the passed cell is not of type ExtendedCell
@Deprecated public static void writeFlatKey(Cell cell, DataOutputStream out) throws IOException
IOException
@Deprecated public static void writeRowSkippingBytes(DataOutputStream out, Cell cell, short rlength, int commonPrefix) throws IOException
out
- The dataoutputstream to which the data has to be writtencell
- The cell whose contents has to be writtenrlength
- the row lengthIOException
public static String getCellKeyAsString(Cell cell)
cell
as a String.public static String getCellKeyAsString(Cell cell, Function<Cell,String> rowConverter)
cell
as a String.cell
- the cell to convertrowConverter
- used to convert the row of the cell to a stringcell
as a String.@Deprecated public static byte[] getCellKeySerializedAsKeyValueKey(Cell cell)
cell
@Deprecated public static void writeRowKeyExcludingCommon(Cell cell, short rLen, int commonPrefix, DataOutputStream out) throws IOException
IOException
@Deprecated public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck, boolean withTsType)
KeyValue
. The key format is <2 bytes rk len><rk><1 byte cf
len><cf><qualifier><8 bytes timestamp><1 byte type>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.public static String toString(Cell cell, boolean verbose)
@Deprecated public static boolean equalsIgnoreMvccVersion(Cell a, Cell b)
public static boolean matchingTimestamp(Cell a, Cell b)
@Deprecated public static boolean matchingType(Cell a, Cell b)
public static boolean matchingRows(Cell left, Cell right)
public static boolean matchingRows(Cell left, short lrowlength, Cell right, short rrowlength)
public static boolean matchingRowColumn(Cell left, Cell right)
public static boolean matchingRowColumnBytes(Cell left, Cell right)
public static final int compareQualifiers(Cell left, byte[] right, int rOffset, int rLength)
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@InterfaceAudience.Private @Deprecated public static final int compare(CellComparator comparator, Cell left, byte[] key, int offset, int length)
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[]public static final int compareFamilies(Cell left, byte[] right, int roffset, int rlength)
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 familypublic static final int compareColumns(Cell left, byte[] right, int rfoffset, int rflength, int rqoffset, int rqlength)
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 qualifierpublic static void cloneIfNecessary(ArrayList<Cell> cells)
public static Cell cloneIfNecessary(Cell cell)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.