@InterfaceAudience.Private @InterfaceStability.Evolving public class CellComparator extends Object implements Comparator<Cell>, Serializable
-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-.Modifier and Type | Class and Description |
---|---|
static class |
CellComparator.RowComparator
Counter part for the KeyValue.RowOnlyComparator
|
Constructor and Description |
---|
CellComparator() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areKeyLengthsEqual(Cell a,
Cell b)
lengths
|
static boolean |
areRowLengthsEqual(Cell a,
Cell b) |
int |
compare(Cell a,
Cell b) |
static int |
compare(Cell a,
Cell b,
boolean ignoreSequenceid)
Compare cells.
|
static int |
compareColumns(Cell left,
Cell right) |
static int |
compareCommonFamilyPrefix(Cell left,
Cell right,
int familyCommonPrefix) |
static int |
compareCommonQualifierPrefix(Cell left,
Cell right,
int qualCommonPrefix) |
static int |
compareCommonRowPrefix(Cell left,
Cell right,
int rowCommonPrefix) |
static int |
compareFamilies(Cell left,
Cell right) |
int |
compareFlatKey(Cell left,
Cell right) |
static int |
compareQualifiers(Cell left,
Cell right) |
static int |
compareRows(byte[] left,
int loffset,
int llength,
byte[] right,
int roffset,
int rlength)
Do not use comparing rows from hbase:meta.
|
static int |
compareRows(Cell left,
Cell right)
Do not use comparing rows from hbase:meta.
|
static int |
compareTimestamps(Cell left,
Cell right)
Compares cell's timestamps in DESCENDING order.
|
static int |
compareWithoutRow(Cell leftCell,
Cell rightCell) |
static boolean |
equals(Cell a,
Cell b)
equals
|
static boolean |
equalsFamily(Cell a,
Cell b) |
static boolean |
equalsIgnoreMvccVersion(Cell a,
Cell b)
special case for KeyValue.equals
|
static boolean |
equalsQualifier(Cell a,
Cell b) |
static boolean |
equalsRow(Cell a,
Cell b) |
static boolean |
equalsTimestamp(Cell a,
Cell b) |
static boolean |
equalsType(Cell a,
Cell b) |
static int |
findCommonPrefixInFamilyPart(Cell left,
Cell right,
int familyCommonPrefix) |
static int |
findCommonPrefixInQualifierPart(Cell left,
Cell right,
int qualifierCommonPrefix) |
static int |
findCommonPrefixInRowPart(Cell left,
Cell right,
int rowCommonPrefix) |
static Cell |
getMidpoint(KeyValue.KVComparator comparator,
Cell left,
Cell right)
Try to return a Cell that falls between
left and right but that is
shorter; i.e. |
static int |
hashCode(Cell cell)
Returns a hash code that is always the same for two Cells having a matching equals(..) result.
|
static int |
hashCodeIgnoreMvcc(Cell cell)
Returns a hash code that is always the same for two Cells having a matching
equals(..) result.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public int compare(Cell a, Cell b)
compare
in interface Comparator<Cell>
public static 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 static int findCommonPrefixInRowPart(Cell left, Cell right, int rowCommonPrefix)
public static int findCommonPrefixInFamilyPart(Cell left, Cell right, int familyCommonPrefix)
public static int findCommonPrefixInQualifierPart(Cell left, Cell right, int qualifierCommonPrefix)
public static int compareRows(Cell left, Cell right)
public static int compareRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
public static int compareTimestamps(Cell left, Cell right)
public static int hashCode(Cell cell)
public static int hashCodeIgnoreMvcc(Cell cell)
cell
- public static int compareCommonRowPrefix(Cell left, Cell right, int rowCommonPrefix)
public static int compareCommonFamilyPrefix(Cell left, Cell right, int familyCommonPrefix)
public static int compareCommonQualifierPrefix(Cell left, Cell right, int qualCommonPrefix)
public static boolean equalsIgnoreMvccVersion(Cell a, Cell b)
public static Cell getMidpoint(KeyValue.KVComparator comparator, Cell left, Cell right)
left
and right
but that is
shorter; i.e. takes up less space. This trick is used building HFile block index.
Its an optimization. It does not always work. In this case we'll just return the
right
cell.comparator
- Comparator to use.left
- right
- left
and right
.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.