Modifier and Type | Method and Description |
---|---|
static byte[] |
cloneFamily(Cell cell) |
static byte[] |
cloneQualifier(Cell cell) |
static byte[] |
cloneRow(Cell cell)
get individual arrays for tests
|
static byte[] |
cloneTags(Cell cell) |
static byte[] |
cloneValue(Cell cell) |
static int |
copyFamilyTo(Cell cell,
byte[] destination,
int destinationOffset) |
static int |
copyQualifierTo(Cell cell,
byte[] destination,
int destinationOffset) |
static int |
copyRowTo(Cell cell,
byte[] destination,
int destinationOffset)
copyTo
|
static int |
copyTagTo(Cell cell,
byte[] destination,
int destinationOffset)
Copies the tags info into the tag portion of the cell
|
static int |
copyValueTo(Cell cell,
byte[] destination,
int destinationOffset) |
static Cell |
createCell(byte[] row)
Create a Cell with specific row.
|
static Cell |
createCell(byte[] row,
byte[] value)
Create a Cell with specific row and value.
|
static Cell |
createCell(byte[] row,
byte[] family,
byte[] qualifier)
Create a Cell with specific row.
|
static Cell |
createCell(byte[] row,
byte[] family,
byte[] qualifier,
long timestamp,
byte type,
byte[] value) |
static Cell |
createCell(byte[] rowArray,
int rowOffset,
int rowLength,
byte[] familyArray,
int familyOffset,
int familyLength,
byte[] qualifierArray,
int qualifierOffset,
int qualifierLength) |
static org.apache.hadoop.hbase.CellScanner |
createCellScanner(Cell[] cellArray) |
static org.apache.hadoop.hbase.CellScanner |
createCellScanner(Iterable<Cell> cellIterable) |
static org.apache.hadoop.hbase.CellScanner |
createCellScanner(Iterator<Cell> cells) |
static org.apache.hadoop.hbase.CellScanner |
createCellScanner(List<? extends org.apache.hadoop.hbase.CellScannable> cellScannerables) |
static org.apache.hadoop.hbase.CellScanner |
createCellScanner(NavigableMap<byte[],List<Cell>> map)
Flatten the map of cells out under the CellScanner
|
static Cell |
createFirstDeleteFamilyCellOnRow(byte[] row,
byte[] fam)
Create a Delete Family Cell for the specified row and family that would
be smaller than all other possible Delete Family KeyValues that have the
same row and family.
|
static Cell |
createFirstOnNextRow(Cell cell)
Create a Cell that is smaller than all other possible Cells for the given Cell row's next row.
|
static Cell |
createFirstOnRow(Cell cell)
Create a Cell that is smaller than all other possible Cells for the given Cell's row.
|
static Cell |
createFirstOnRowCol(Cell cell)
Create a Cell that is smaller than all other possible Cells for the given Cell's row.
|
static Cell |
createFirstOnRowCol(Cell cell,
byte[] qArray,
int qoffest,
int qlength)
Create a Cell that is smaller than all other possible Cells for the given Cell's rk:cf and
passed qualifier.
|
static Cell |
createFirstOnRowColTS(Cell cell,
long ts)
Creates the first cell with the row/family/qualifier of this cell and the given timestamp.
|
static Cell |
createLastOnRow(Cell cell)
Create a Cell that is larger than all other possible Cells for the given Cell's row.
|
static Cell |
createLastOnRowCol(Cell cell)
Create a Cell that is larger than all other possible Cells for the given Cell's rk:cf:q.
|
static boolean |
equals(Cell a,
Cell b)
equals
|
static boolean |
equalsIgnoreMvccVersion(Cell a,
Cell b)
special case for Cell.equals
|
static long |
estimatedHeapSizeOf(Cell cell)
This is an estimate of the heap space occupied by a cell.
|
static int |
estimatedSerializedSizeOf(Cell cell) |
static int |
estimatedSerializedSizeOfKey(Cell cell) |
static ByteRange |
fillFamilyRange(Cell cell,
ByteRange range) |
static ByteRange |
fillQualifierRange(Cell cell,
ByteRange range) |
static ByteRange |
fillRowRange(Cell cell,
ByteRange range)
ByteRange
|
static ByteRange |
fillTagRange(Cell cell,
ByteRange range) |
static ByteRange |
fillValueRange(Cell cell,
ByteRange range) |
static int |
findCommonPrefixInFlatKey(Cell c1,
Cell c2,
boolean bypassFamilyCheck,
boolean withTsType)
Find length of common prefix in keys of the cells, considering key as byte[] if serialized in
KeyValue . |
static String |
getCellKeyAsString(Cell cell) |
static byte[] |
getCellKeySerializedAsKeyValueKey(Cell cell)
This method exists just to encapsulate how we serialize keys.
|
static ByteBuffer |
getQualifierBufferShallowCopy(Cell cell)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
|
static int |
getRowAsInt(Cell cell)
Converts the rowkey bytes of the given cell into an int value
|
static byte |
getRowByte(Cell cell,
int index)
misc
|
static byte[] |
getTagArray(Cell cell)
Returns tag value in a new byte array.
|
static BigDecimal |
getValueAsBigDecimal(Cell cell)
Converts the value bytes of the given cell into a BigDecimal
|
static double |
getValueAsDouble(Cell cell)
Converts the value bytes of the given cell into a double value
|
static long |
getValueAsLong(Cell cell)
Converts the value bytes of the given cell into a long value
|
static ByteBuffer |
getValueBufferShallowCopy(Cell cell) |
static boolean |
isDelete(byte type) |
static boolean |
isDelete(Cell cell) |
static boolean |
isDeleteColumnOrFamily(Cell cell) |
static boolean |
isDeleteColumns(Cell cell) |
static boolean |
isDeleteColumnVersion(Cell cell) |
static boolean |
isDeleteFamily(Cell cell) |
static boolean |
isDeleteFamilyVersion(Cell cell) |
static boolean |
isDeleteType(Cell cell) |
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) |
static boolean |
matchingColumn(Cell left,
Cell right) |
static boolean |
matchingFamily(Cell left,
byte[] buf) |
static boolean |
matchingFamily(Cell left,
byte[] buf,
int offset,
int length) |
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)
Finds if the qualifier part of the cell and the KV serialized
byte[] are equal
|
static boolean |
matchingQualifier(Cell left,
Cell right) |
static boolean |
matchingRow(Cell left,
byte[] buf) |
static boolean |
matchingRow(Cell left,
byte[] buf,
int offset,
int length) |
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 |
matchingRows(Cell left,
Cell right)
Compares the row of two keyvalues for equality
|
static boolean |
matchingTimestamp(Cell a,
Cell b) |
static boolean |
matchingType(Cell a,
Cell b) |
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)
Returns true if the first range start1...end1 overlaps with the second range
start2...end2, assuming the byte arrays represent row keys
|
static void |
setTimestamp(Cell cell,
byte[] ts,
int tsOffset)
Sets the given timestamp to the cell.
|
static void |
setTimestamp(Cell cell,
long ts)
Sets the given timestamp to the cell.
|
static Iterator<org.apache.hadoop.hbase.Tag> |
tagsIterator(byte[] tags,
int offset,
int length)
Util method to iterate through the tags
|
static String |
toString(Cell cell,
boolean verbose)
Returns a string representation of the cell
|
static boolean |
updateLatestStamp(Cell cell,
byte[] ts,
int tsOffset)
Sets the given timestamp to the cell iff current timestamp is
HConstants.LATEST_TIMESTAMP . |
static boolean |
updateLatestStamp(Cell cell,
long ts)
Sets the given timestamp to the cell iff current timestamp is
HConstants.LATEST_TIMESTAMP . |
static void |
writeFlatKey(Cell cell,
DataOutputStream out)
Writes the Cell's key part as it would have serialized in a KeyValue.
|
static void |
writeRowKeyExcludingCommon(Cell cell,
short rLen,
int commonPrefix,
DataOutputStream out)
Write rowkey excluding the common part.
|
public static ByteRange fillRowRange(Cell cell, ByteRange range)
public static ByteRange fillFamilyRange(Cell cell, ByteRange range)
public static ByteRange fillQualifierRange(Cell cell, ByteRange range)
public static ByteRange fillValueRange(Cell cell, ByteRange range)
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)
public static byte[] getTagArray(Cell cell)
Tag.getBuffer()
with appropriate Tag.getTagOffset()
and
Tag.getTagLength()
instead to save on allocations.cell
- public static int copyFamilyTo(Cell cell, byte[] destination, int destinationOffset)
public static int copyQualifierTo(Cell cell, byte[] destination, int destinationOffset)
public static int copyValueTo(Cell cell, byte[] destination, int destinationOffset)
public static int copyTagTo(Cell cell, byte[] destination, int destinationOffset)
cell
- destination
- destinationOffset
- public static byte getRowByte(Cell cell, int index)
public static ByteBuffer getValueBufferShallowCopy(Cell cell)
@Deprecated public static ByteBuffer getQualifierBufferShallowCopy(Cell cell)
cell
- public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value)
public static Cell createCell(byte[] rowArray, int rowOffset, int rowLength, byte[] familyArray, int familyOffset, int familyLength, byte[] qualifierArray, int qualifierOffset, int qualifierLength)
public static Cell createCell(byte[] row)
row
- public static Cell createCell(byte[] row, byte[] value)
row
- value
- public static Cell createCell(byte[] row, byte[] family, byte[] qualifier)
row
- family
- qualifier
- public static org.apache.hadoop.hbase.CellScanner createCellScanner(List<? extends org.apache.hadoop.hbase.CellScannable> cellScannerables)
cellScannerables
- cellIterables
public static org.apache.hadoop.hbase.CellScanner createCellScanner(Iterable<Cell> cellIterable)
cellIterable
- cellIterable
public static org.apache.hadoop.hbase.CellScanner createCellScanner(Iterator<Cell> cells)
cells
- cellIterable
or null if cells
is
nullpublic static org.apache.hadoop.hbase.CellScanner createCellScanner(Cell[] cellArray)
cellArray
- cellArray
public static org.apache.hadoop.hbase.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
- right
- left
and right
Cells matchpublic static boolean matchingRow(Cell left, byte[] buf)
public static boolean matchingRow(Cell left, byte[] buf, int offset, int length)
public static boolean matchingFamily(Cell left, Cell right)
public static boolean matchingFamily(Cell left, byte[] buf)
public static boolean matchingFamily(Cell left, byte[] buf, int offset, int length)
public static boolean matchingQualifier(Cell left, Cell right)
public static boolean matchingQualifier(Cell left, byte[] buf)
left
- buf
- the serialized keyvalue format byte[]public static boolean matchingQualifier(Cell left, byte[] buf, int offset, int length)
left
- 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 matchingColumn(Cell left, byte[] fam, int foffset, int flength, byte[] qual, int qoffset, int qlength)
public static boolean matchingColumn(Cell left, Cell right)
public static boolean matchingValue(Cell left, Cell right)
public static boolean matchingValue(Cell left, byte[] buf)
public static boolean isDelete(Cell cell)
KeyValue.Type.Delete
or a
{KeyValue.Type#DeleteFamily} or a
KeyValue.Type.DeleteColumn
KeyValue type.public static boolean isDelete(byte type)
KeyValue.Type.Delete
or a
{KeyValue.Type#DeleteFamily} or a
KeyValue.Type.DeleteColumn
KeyValue type.public static boolean isDeleteType(Cell cell)
KeyValue.Type.Delete
type.public static boolean isDeleteFamily(Cell cell)
public static boolean isDeleteFamilyVersion(Cell cell)
public static boolean isDeleteColumns(Cell cell)
public static boolean isDeleteColumnVersion(Cell cell)
public static boolean isDeleteColumnOrFamily(Cell cell)
public static int estimatedSerializedSizeOf(Cell cell)
cell
- cell
size in bytes.public static int estimatedSerializedSizeOfKey(Cell cell)
public static long estimatedHeapSizeOf(Cell cell)
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.cell
- public static Iterator<org.apache.hadoop.hbase.Tag> tagsIterator(byte[] tags, int offset, int length)
tags
- offset
- length
- public static boolean overlappingKeys(byte[] start1, byte[] end1, byte[] start2, byte[] end2)
public static void setTimestamp(Cell cell, long ts) throws IOException
cell
- ts
- IOException
- when the passed cell is not of type SettableTimestamp
public static void setTimestamp(Cell cell, byte[] ts, int tsOffset) throws IOException
cell
- ts
- buffer containing the timestamp valuetsOffset
- offset to the new timestampIOException
- when the passed cell is not of type SettableTimestamp
public static boolean updateLatestStamp(Cell cell, long ts) throws IOException
HConstants.LATEST_TIMESTAMP
.cell
- ts
- IOException
- when the passed cell is not of type SettableTimestamp
public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException
HConstants.LATEST_TIMESTAMP
.cell
- ts
- buffer containing the timestamp valuetsOffset
- offset to the new timestampIOException
- when the passed cell is not of type SettableTimestamp
public static void writeFlatKey(Cell cell, DataOutputStream out) throws IOException
cell
- out
- IOException
public static String getCellKeyAsString(Cell cell)
cell
- cell
as a String.public static byte[] getCellKeySerializedAsKeyValueKey(Cell cell)
cell
- cell
public static void writeRowKeyExcludingCommon(Cell cell, short rLen, int commonPrefix, DataOutputStream out) throws IOException
cell
- rLen
- commonPrefix
- out
- IOException
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)
public static boolean equalsIgnoreMvccVersion(Cell a, Cell b)
public static boolean matchingTimestamp(Cell a, Cell b)
public static boolean matchingType(Cell a, Cell b)
public static boolean matchingRows(Cell left, Cell right)
left
- right
- public static boolean matchingRowColumn(Cell left, Cell right)
left
- right
- public static int getRowAsInt(Cell cell)
cell
- public static long getValueAsLong(Cell cell)
cell
- public static double getValueAsDouble(Cell cell)
cell
- public static BigDecimal getValueAsBigDecimal(Cell cell)
cell
- public static Cell createFirstOnRow(Cell cell)
cell
- public static Cell createFirstOnRowCol(Cell cell)
cell
- public static Cell createFirstOnNextRow(Cell cell)
public static Cell createFirstOnRowCol(Cell cell, byte[] qArray, int qoffest, int qlength)
cell
- qArray
- qoffest
- qlength
- public static Cell createFirstOnRowColTS(Cell cell, long ts)
cell
- - cellts
- public static Cell createLastOnRow(Cell cell)
cell
- public static Cell createLastOnRowCol(Cell cell)
cell
- public static Cell createFirstDeleteFamilyCellOnRow(byte[] row, byte[] fam)
row
- - row key (arbitrary byte array)fam
- - family namerow
.Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.