@InterfaceAudience.Private @InterfaceStability.Evolving public class MetaCellComparator extends CellComparatorImpl
Modifier and Type | Class and Description |
---|---|
private static interface |
MetaCellComparator.Compare<L,R> |
private static interface |
MetaCellComparator.SearchDelimiter<T> |
private static interface |
MetaCellComparator.SearchDelimiterInReverse<T> |
Modifier and Type | Field and Description |
---|---|
static MetaCellComparator |
META_COMPARATOR
|
COMPARATOR
Constructor and Description |
---|
MetaCellComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Cell a,
Cell b,
boolean ignoreSequenceid)
Compare cells.
|
private static int |
compareBBAndBytesRows(ByteBuffer left,
int loffset,
int llength,
byte[] right,
int roffset,
int rlength) |
private static int |
compareBBRows(ByteBuffer left,
int loffset,
int llength,
ByteBuffer right,
int roffset,
int rlength) |
private static int |
compareBytesRows(byte[] left,
int loffset,
int llength,
byte[] right,
int roffset,
int rlength) |
int |
compareRows(byte[] leftRow,
byte[] rightRow)
Compares two row bytes
|
int |
compareRows(ByteBuffer row,
Cell cell)
Lexicographically compare two rows
|
int |
compareRows(Cell left,
byte[] right,
int roffset,
int rlength)
Compares the row part of the cell with a simple plain byte[] like the stopRow in Scan.
|
int |
compareRows(Cell left,
Cell right)
Compares the rows of the left and right cell.
|
private static <L,R> int |
compareRows(L left,
int loffset,
int llength,
R right,
int roffset,
int rlength,
MetaCellComparator.SearchDelimiter<L> searchLeft,
MetaCellComparator.SearchDelimiter<R> searchRight,
MetaCellComparator.SearchDelimiterInReverse<L> searchInReverseLeft,
MetaCellComparator.SearchDelimiterInReverse<R> searchInReverseRight,
MetaCellComparator.Compare<L,R> comparator) |
Comparator |
getSimpleComparator()
Return a dumbed-down, fast comparator for hbase2 base-type, the
ByteBufferKeyValue . |
compare, compareColumns, compareFamilies, compareQualifiers, compareQualifiers, compareQualifiers, compareQualifiers, compareQualifiers, compareRows, compareTimestamps, compareTimestamps, compareWithoutRow, getCellComparator, getCellComparator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInstance
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final MetaCellComparator META_COMPARATOR
public MetaCellComparator()
public int compareRows(Cell left, Cell right)
CellComparatorImpl
compareRows
in interface CellComparator
compareRows
in class CellComparatorImpl
left
- the left hand side cellright
- the right hand side cellpublic int compareRows(Cell left, byte[] right, int roffset, int rlength)
CellComparatorImpl
META_COMPARATOR
should be used n * the cell to be compared n * the
kv serialized byte[] to be compared with n * the offset in the byte[] n * the length in the
byte[]compareRows
in interface CellComparator
compareRows
in class CellComparatorImpl
left
- the cellright
- the byte[] representing the row to be compared withroffset
- the offset of the byte[]rlength
- the length of the byte[]public int compareRows(byte[] leftRow, byte[] rightRow)
CellComparator
leftRow
- the byte array of the left rowrightRow
- the byte array of the right rowpublic int compare(Cell a, Cell b, boolean ignoreSequenceid)
CellComparator
compare
in interface CellComparator
compare
in class CellComparatorImpl
ignoreSequenceid
- True if we are to compare the key portion only and ignore the
sequenceid. Set to false to compare key and consider sequenceid.private static <L,R> int compareRows(L left, int loffset, int llength, R right, int roffset, int rlength, MetaCellComparator.SearchDelimiter<L> searchLeft, MetaCellComparator.SearchDelimiter<R> searchRight, MetaCellComparator.SearchDelimiterInReverse<L> searchInReverseLeft, MetaCellComparator.SearchDelimiterInReverse<R> searchInReverseRight, MetaCellComparator.Compare<L,R> comparator)
private static int compareBBRows(ByteBuffer left, int loffset, int llength, ByteBuffer right, int roffset, int rlength)
private static int compareBBAndBytesRows(ByteBuffer left, int loffset, int llength, byte[] right, int roffset, int rlength)
private static int compareBytesRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
public int compareRows(ByteBuffer row, Cell cell)
CellComparator
row
- ByteBuffer that wraps a row; will read from current position and will reading all
remaining; will not disturb the ByteBuffer internal state.public Comparator getSimpleComparator()
CellComparator
ByteBufferKeyValue
.
Create an instance when you make a new memstore, when you know only BBKVs will be passed. Do
not pollute with types other than BBKV if can be helped; the Comparator will slow.getSimpleComparator
in interface CellComparator
getSimpleComparator
in class CellComparatorImpl
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.