| Constructor and Description |
|---|
CellUtil() |
| 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[] |
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,
byte[] family,
byte[] qualifier,
long timestamp,
byte type,
byte[] value) |
static Cell |
createCell(byte[] row,
byte[] family,
byte[] qualifier,
long timestamp,
byte type,
byte[] value,
byte[] tags,
long memstoreTS) |
static Cell |
createCell(byte[] row,
byte[] family,
byte[] qualifier,
long timestamp,
byte type,
byte[] value,
long memstoreTS) |
static Cell |
createCell(byte[] row,
byte[] family,
byte[] qualifier,
long timestamp,
KeyValue.Type type,
byte[] value,
byte[] tags) |
static CellScanner |
createCellScanner(Cell[] cellArray) |
static CellScanner |
createCellScanner(Iterable<Cell> cellIterable) |
static CellScanner |
createCellScanner(Iterator<Cell> cells) |
static CellScanner |
createCellScanner(List<? extends CellScannable> cellScannerables) |
static CellScanner |
createCellScanner(NavigableMap<byte[],List<Cell>> map)
Flatten the map of cells out under the CellScanner
|
static long |
estimatedHeapSizeOf(Cell cell)
This is an estimate of the heap space occupied by a cell.
|
static int |
estimatedLengthOf(Cell cell)
Estimation of total number of bytes used by the cell to store its key, value and tags.
|
static int |
estimatedSizeOf(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 ByteBuffer |
getQualifierBufferShallowCopy(Cell cell) |
static byte |
getRowByte(Cell cell,
int index)
misc
|
static byte[] |
getTagArray(Cell cell)
Returns tag value in a new byte array.
|
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) |
static boolean |
matchingQualifier(Cell left,
byte[] buf,
int offset,
int length) |
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) |
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 |
setSequenceId(Cell cell,
long seqId)
Sets the given seqId to the cell.
|
static Iterator<Tag> |
tagsIterator(byte[] tags,
int offset,
int length)
Util method to iterate through the tags
|
public static byte[] cloneRow(Cell cell)
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 copyRowTo(Cell cell, byte[] destination, int destinationOffset)
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)
public static ByteBuffer getQualifierBufferShallowCopy(Cell cell)
public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value)
public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, long memstoreTS)
public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value, byte[] tags, long memstoreTS)
public static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, KeyValue.Type type, byte[] value, byte[] tags)
public static CellScanner createCellScanner(List<? extends CellScannable> cellScannerables)
cellScannerables - cellIterablespublic static CellScanner createCellScanner(Iterable<Cell> cellIterable)
cellIterable - cellIterablepublic static CellScanner createCellScanner(Iterator<Cell> cells)
cells - cellIterable or null if cells is
nullpublic static CellScanner createCellScanner(Cell[] cellArray)
cellArray - cellArraypublic 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.cellIterablepublic static boolean matchingRow(Cell left, Cell right)
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, byte[] buf)
public static boolean matchingFamily(Cell left, byte[] buf, int offset, int length)
public static boolean matchingQualifier(Cell left, byte[] buf)
public static boolean matchingQualifier(Cell left, byte[] buf, int offset, int length)
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 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 estimatedSizeOf(Cell cell)
cell - cell size in bytes.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 byte occupied by the cell components ie. row, CF, qualifier,
timestamp, type, value and tags.cell - public static Iterator<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 setSequenceId(Cell cell, long seqId) throws IOException
cell - seqId - IOException - when the passed cell is not of type SettableSequenceIdCopyright © 2014 The Apache Software Foundation. All Rights Reserved.