Package org.apache.hadoop.hbase
Class KeyValue.KVComparator
java.lang.Object
org.apache.hadoop.hbase.KeyValue.KVComparator
- All Implemented Interfaces:
Comparator<Cell>
,KeyValue.SamePrefixComparator<byte[]>
,org.apache.hadoop.io.RawComparator<Cell>
- Direct Known Subclasses:
KeyValue.MetaComparator
- Enclosing class:
- KeyValue
@Deprecated
public static class KeyValue.KVComparator
extends Object
implements org.apache.hadoop.io.RawComparator<Cell>, KeyValue.SamePrefixComparator<byte[]>
Deprecated.
Compare KeyValues. When we compare KeyValues, we only compare the Key portion. This means two
KeyValues with same Key but different Values are considered the same as far as this Comparator
is concerned.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
calcIndexKey
(byte[] lastKeyOfPreviousBlock, byte[] firstKeyInBlock) Deprecated.protected KeyValue.KVComparator
clone()
Deprecated.int
compare
(byte[] l, int loff, int llen, byte[] r, int roff, int rlen) Deprecated.int
Deprecated.Compares the Key of a cell -- with fields being more significant in this order: rowkey, colfam/qual, timestamp, type, mvccprotected int
compareColumns
(byte[] left, int loffset, int lquallength, byte[] right, int roffset, int rquallength) Deprecated.protected int
compareColumns
(byte[] left, int loffset, int llength, int lfamilylength, byte[] right, int roffset, int rlength, int rfamilylength) Deprecated.(package private) int
compareColumns
(Cell left, short lrowlength, Cell right, short rrowlength) Deprecated.protected int
compareFamilies
(byte[] left, int loffset, int lfamilylength, byte[] right, int roffset, int rfamilylength) Deprecated.int
compareFlatKey
(byte[] left, byte[] right) Deprecated.int
compareFlatKey
(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Compares left to right assuming that left,loffset,llength and right,roffset,rlength are full KVs laid out in a flat byte[]s.int
compareIgnoringPrefix
(int commonPrefix, byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Overriddenint
compareKey
(Cell cell, byte[] row, int roff, int rlen, byte[] fam, int foff, int flen, byte[] col, int coff, int clen, long ts, byte type) Deprecated.int
compareOnlyKeyPortion
(Cell left, Cell right) Deprecated.protected int
compareRowKey
(Cell left, Cell right) Deprecated.Compares the only the user specified portion of a Key.int
compareRows
(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Get the b[],o,l for left and right rowkey portions and compare.int
compareRows
(Cell left, Cell right) Deprecated.Compares the rows of a cell(package private) static int
compareTimestamps
(long ltimestamp, long rtimestamp) Deprecated.int
compareTimestamps
(Cell left, Cell right) Deprecated.private int
compareWithoutRow
(int commonPrefix, byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength, short rowlength) Deprecated.Compare columnFamily, qualifier, timestamp, and key type (everything except the row).Deprecated.The HFileV2 file format's trailer contains this class name.byte[]
getShortMidpointKey
(byte[] leftKey, byte[] rightKey) Deprecated.Since 0.99.2;boolean
matchingRowColumn
(Cell left, Cell right) Deprecated.Compares the row and column of two keyvalues for equalityboolean
matchingRows
(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Compare rows.private boolean
matchingRows
(Cell left, short lrowlength, Cell right, short rrowlength) Deprecated.Compares the row of two keyvalues for equalityboolean
matchingRows
(Cell left, Cell right) Deprecated.Compares the row of two keyvalues for equalityMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
KVComparator
public KVComparator()Deprecated.
-
-
Method Details
-
getLegacyKeyComparatorName
Deprecated.The HFileV2 file format's trailer contains this class name. We reinterpret this and instantiate the appropriate comparator. TODO: With V3 consider removing this.- Returns:
- legacy class name for FileFileTrailer#comparatorClassName
-
compare
Deprecated.- Specified by:
compare
in interfaceorg.apache.hadoop.io.RawComparator<Cell>
-
compareRowKey
Deprecated.Compares the only the user specified portion of a Key. This is overridden by MetaComparator.- Parameters:
left
- left cell to compare row keyright
- right cell to compare row key- Returns:
- 0 if equal, <0 if left smaller, >0 if right smaller
-
compareFlatKey
public int compareFlatKey(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Compares left to right assuming that left,loffset,llength and right,roffset,rlength are full KVs laid out in a flat byte[]s.- Parameters:
left
- the left kv serialized byte[] to be compared withloffset
- the offset in the left byte[]llength
- the length in the left byte[]right
- the right kv serialized byte[] to be compared withroffset
- the offset in the right byte[]rlength
- the length in the right byte[]- Returns:
- 0 if equal, <0 if left smaller, >0 if right smaller
-
compareFlatKey
Deprecated. -
compareKey
public int compareKey(Cell cell, byte[] row, int roff, int rlen, byte[] fam, int foff, int flen, byte[] col, int coff, int clen, long ts, byte type) Deprecated. -
compareOnlyKeyPortion
Deprecated. -
compare
Deprecated.Compares the Key of a cell -- with fields being more significant in this order: rowkey, colfam/qual, timestamp, type, mvcc- Specified by:
compare
in interfaceComparator<Cell>
-
compareTimestamps
Deprecated. -
compareRows
Deprecated.Compares the rows of a cell- Parameters:
left
- left cell to compare rows forright
- right cell to compare rows for- Returns:
- Result comparing rows.
-
compareRows
public int compareRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Get the b[],o,l for left and right rowkey portions and compare.- Parameters:
left
- the left kv serialized byte[] to be compared withloffset
- the offset in the left byte[]llength
- the length in the left byte[]right
- the right kv serialized byte[] to be compared withroffset
- the offset in the right byte[]rlength
- the length in the right byte[]- Returns:
- 0 if equal, <0 if left smaller, >0 if right smaller
-
compareColumns
Deprecated. -
compareColumns
protected int compareColumns(byte[] left, int loffset, int llength, int lfamilylength, byte[] right, int roffset, int rlength, int rfamilylength) Deprecated. -
compareTimestamps
Deprecated. -
compareIgnoringPrefix
public int compareIgnoringPrefix(int commonPrefix, byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Overridden- Specified by:
compareIgnoringPrefix
in interfaceKeyValue.SamePrefixComparator<byte[]>
- Parameters:
commonPrefix
- location of expected common prefixleft
- the left kv serialized byte[] to be compared withloffset
- the offset in the left byte[]llength
- the length in the left byte[]right
- the right kv serialized byte[] to be compared withroffset
- the offset in the byte[]rlength
- the length in the right byte[]- Returns:
- 0 if equal, <0 if left smaller, >0 if right smaller
-
compareWithoutRow
private int compareWithoutRow(int commonPrefix, byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength, short rowlength) Deprecated.Compare columnFamily, qualifier, timestamp, and key type (everything except the row). This method is used both in the normal comparator and the "same-prefix" comparator. Note that we are assuming that row portions of both KVs have already been parsed and found identical, and we don't validate that assumption here. the length of the common prefix of the two key-values being compared, including row length and row -
compareFamilies
protected int compareFamilies(byte[] left, int loffset, int lfamilylength, byte[] right, int roffset, int rfamilylength) Deprecated. -
compareColumns
protected int compareColumns(byte[] left, int loffset, int lquallength, byte[] right, int roffset, int rquallength) Deprecated. -
matchingRowColumn
Deprecated.Compares the row and column of two keyvalues for equality- Parameters:
left
- left cell to compare row and columnright
- right cell to compare row and column- Returns:
- True if same row and column.
-
matchingRows
Deprecated.Compares the row of two keyvalues for equality- Parameters:
left
- left cell to compare rowright
- right cell to compare row- Returns:
- True if rows match.
-
matchingRows
Deprecated.Compares the row of two keyvalues for equality- Parameters:
left
- left cell to compare rowlrowlength
- left row lengthright
- right cell to compare rowrrowlength
- right row length- Returns:
- True if rows match.
-
matchingRows
public boolean matchingRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength) Deprecated.Compare rows. Just calls Bytes.equals, but it's good to have this encapsulated.- Parameters:
left
- Left row array.loffset
- Left row offset.llength
- Left row length.right
- Right row array.roffset
- Right row offset.rlength
- Right row length.- Returns:
- Whether rows are the same row.
-
calcIndexKey
Deprecated. -
getShortMidpointKey
Deprecated.Since 0.99.2;This is a HFile block index key optimization.- Parameters:
leftKey
- byte array for left KeyrightKey
- byte array for right Key- Returns:
- 0 if equal, <0 if left smaller, >0 if right smaller
-
clone
Deprecated.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
CellComparatorImpl
. Deprecated for hbase 2.0, remove for hbase 3.0.