@InterfaceAudience.Private @InterfaceStability.Evolving public class CellComparatorImpl extends Object implements CellComparator
-ROOT- or
hbase:meta cells. Cells from these tables need a specialized comparator, one that
takes account of the special formatting of the row where we have commas to delimit table from
regionname, from row. See KeyValue for how it has a special comparator to do hbase:meta cells
and yet another for -ROOT-.
While using this comparator for {compareRows(Cell, Cell) et al, the hbase:meta cells
format should be taken into consideration, for which the instance of this comparator
should be used. In all other cases the static APIs in this comparator would be enough
HOT methods. We spend a good portion of CPU comparing. Anything that makes the compare
faster will likely manifest at the macro level. See also
BBKVComparator. Use it when mostly ByteBufferKeyValues.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CellComparatorImpl.MetaCellComparator
|
| 限定符和类型 | 字段和说明 |
|---|---|
static CellComparatorImpl |
COMPARATOR
Comparator for plain key/values; i.e. non-catalog table key/values.
|
static CellComparatorImpl |
META_COMPARATOR
|
| 构造器和说明 |
|---|
CellComparatorImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compare(Cell a,
Cell b)
Lexographically compares two cells.
|
int |
compare(Cell a,
Cell b,
boolean ignoreSequenceid)
Compare cells.
|
int |
compareColumns(Cell left,
Cell right)
Compares the family and qualifier part of the cell
|
int |
compareFamilies(Cell left,
Cell right)
Compare the families of left and right cell
|
int |
compareQualifiers(Cell left,
Cell right)
Compare the qualifiers part of the left and right cells.
|
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.
|
int |
compareTimestamps(Cell left,
Cell right)
Compares cell's timestamps in DESCENDING order.
|
int |
compareTimestamps(long ltimestamp,
long rtimestamp)
Compares cell's timestamps in DESCENDING order.
|
int |
compareWithoutRow(Cell left,
Cell right)
Lexographically compares the two cells excluding the row part.
|
Comparator |
getSimpleComparator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInstancepublic static final CellComparatorImpl COMPARATOR
public static final CellComparatorImpl META_COMPARATOR
public final int compare(Cell a, Cell b)
CellComparatorcompare 在接口中 Comparator<Cell>compare 在接口中 CellComparatora - the left hand side cellb - the right hand side cellpublic int compare(Cell a, Cell b, boolean ignoreSequenceid)
CellComparatorcompare 在接口中 CellComparatorignoreSequenceid - True if we are to compare the key portion only and ignore
the sequenceid. Set to false to compare key and consider sequenceid.public final int compareColumns(Cell left, Cell right)
public final int compareFamilies(Cell left, Cell right)
compareFamilies 在接口中 CellComparatorleft - the left hand side cellright - the right hand side cellpublic final int compareQualifiers(Cell left, Cell right)
compareQualifiers 在接口中 CellComparatorleft - the left hand side cellright - the right hand side cellpublic int compareRows(Cell left, Cell right)
compareRows 在接口中 CellComparatorleft - the left hand side cellright - the right hand side cellpublic int compareRows(Cell left, byte[] right, int roffset, int rlength)
META_COMPARATOR should be usedcompareRows 在接口中 CellComparatorleft - the cell to be comparedright - the kv serialized byte[] to be compared withroffset - the offset in the byte[]rlength - the length in the byte[]public final int compareWithoutRow(Cell left, Cell right)
CellComparatorcompareWithoutRow 在接口中 CellComparatorleft - the left hand side cellright - the right hand side cellpublic int compareTimestamps(Cell left, Cell right)
CellComparatorcompareTimestamps 在接口中 CellComparatorleft - the left hand side cellright - the right hand side cellpublic int compareTimestamps(long ltimestamp,
long rtimestamp)
CellComparatorcompareTimestamps 在接口中 CellComparatorltimestamp - the left cell's timestamprtimestamp - the right cell's timestamppublic Comparator getSimpleComparator()
getSimpleComparator 在接口中 CellComparatorByteBufferKeyValue.
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.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.