@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 enoughModifier and Type | Class and Description |
---|---|
static class |
CellComparatorImpl.MetaCellComparator
|
Modifier and Type | Field and Description |
---|---|
static CellComparatorImpl |
COMPARATOR
Comparator for plain key/values; i.e.
|
static CellComparatorImpl |
META_COMPARATOR
|
Constructor and Description |
---|
CellComparatorImpl() |
Modifier and Type | Method and Description |
---|---|
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 timestamps in DESCENDING order.
|
int |
compareWithoutRow(Cell left,
Cell right)
Lexographically compares the two cells excluding the row part.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final CellComparatorImpl COMPARATOR
public static final CellComparatorImpl META_COMPARATOR
public int compare(Cell a, Cell b)
CellComparator
compare
in interface Comparator<Cell>
compare
in interface CellComparator
a
- the left hand side cellb
- the right hand side cellpublic final int compare(Cell a, Cell b, boolean ignoreSequenceid)
a
- b
- ignoreSequenceid
- 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)
left
- the left cellright
- the right cellpublic final int compareFamilies(Cell left, Cell right)
compareFamilies
in interface CellComparator
left
- right
- public final int compareQualifiers(Cell left, Cell right)
compareQualifiers
in interface CellComparator
left
- right
- public int compareRows(Cell left, Cell right)
compareRows
in interface CellComparator
left
- right
- public int compareRows(Cell left, byte[] right, int roffset, int rlength)
META_COMPARATOR
should be usedcompareRows
in interface CellComparator
left
- 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)
CellComparator
compareWithoutRow
in interface CellComparator
left
- the left hand side cellright
- the right hand side cellpublic int compareTimestamps(Cell left, Cell right)
compareTimestamps
in interface CellComparator
left
- the left hand side cellright
- the right hand side cellpublic int compareTimestamps(long ltimestamp, long rtimestamp)
compareTimestamps
in interface CellComparator
ltimestamp
- the left cell's timestamprtimestamp
- the right cell's timestampCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.