org.apache.hadoop.hbase
Class HStoreKey.StoreKeyComparator

java.lang.Object
  extended by org.apache.hadoop.hbase.HStoreKey.StoreKeyComparator
All Implemented Interfaces:
Comparator<byte[]>, org.apache.hadoop.io.RawComparator<byte[]>
Direct Known Subclasses:
HStoreKey.MetaStoreKeyComparator
Enclosing class:
HStoreKey

public static class HStoreKey.StoreKeyComparator
extends Object
implements org.apache.hadoop.io.RawComparator<byte[]>

RawComparator for plain -- i.e. non-catalog table keys such as -ROOT- and .META. -- HStoreKeys. Compares at byte level. Knows how to handle the vints that introduce row and columns in the HSK byte array representation. Adds compareRows(byte[], int, int, byte[], int, int) to RawComparator


Constructor Summary
HStoreKey.StoreKeyComparator()
           
 
Method Summary
 int compare(byte[] b1, byte[] b2)
           
 int compare(byte[] b1, int o1, int l1, byte[] b2, int o2, int l2)
           
 int compareRows(byte[] left, byte[] right)
           
 int compareRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

HStoreKey.StoreKeyComparator

public HStoreKey.StoreKeyComparator()
Method Detail

compare

public int compare(byte[] b1,
                   byte[] b2)
Specified by:
compare in interface Comparator<byte[]>

compare

public int compare(byte[] b1,
                   int o1,
                   int l1,
                   byte[] b2,
                   int o2,
                   int l2)
Specified by:
compare in interface org.apache.hadoop.io.RawComparator<byte[]>

compareRows

public int compareRows(byte[] left,
                       byte[] right)
Parameters:
left -
right -
Returns:
Result comparing rows.

compareRows

public int compareRows(byte[] left,
                       int loffset,
                       int llength,
                       byte[] right,
                       int roffset,
                       int rlength)
Parameters:
left -
loffset -
llength -
right -
roffset -
rlength -
Returns:
Result comparing rows.


Copyright © 2010 The Apache Software Foundation