org.apache.hadoop.hbase
Class KeyValue.MetaKeyComparator

java.lang.Object
  extended by org.apache.hadoop.hbase.KeyValue.KeyComparator
      extended by org.apache.hadoop.hbase.KeyValue.MetaKeyComparator
All Implemented Interfaces:
Comparator<byte[]>, KeyValue.SamePrefixComparator<byte[]>, org.apache.hadoop.io.RawComparator<byte[]>
Enclosing class:
KeyValue

public static class KeyValue.MetaKeyComparator
extends KeyValue.KeyComparator

Compare key portion of a KeyValue for keys in .META. table.


Constructor Summary
KeyValue.MetaKeyComparator()
           
 
Method Summary
protected  int compareRowid(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
           
 int compareRows(byte[] left, int loffset, int llength, byte[] right, int roffset, int rlength)
           
 byte[] getShortMidpointKey(byte[] leftKey, byte[] rightKey)
          Generate a faked byte array if possible.
 
Methods inherited from class org.apache.hadoop.hbase.KeyValue.KeyComparator
compare, compare, compareColumns, compareIgnoringPrefix
 
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

KeyValue.MetaKeyComparator

public KeyValue.MetaKeyComparator()
Method Detail

compareRows

public int compareRows(byte[] left,
                       int loffset,
                       int llength,
                       byte[] right,
                       int roffset,
                       int rlength)
Overrides:
compareRows in class KeyValue.KeyComparator

getShortMidpointKey

public byte[] getShortMidpointKey(byte[] leftKey,
                                  byte[] rightKey)
Description copied from class: KeyValue.KeyComparator
Generate a faked byte array if possible. It aims to: 1)reduce key length, which expects to reduce HFile index memory footprint 2)replace TS field with LATEST_TIMESTAMP(to avoid seeking previous block) see HBASE-7845 for more details we need to ensure: leftKey < newKey <= rightKey

Overrides:
getShortMidpointKey in class KeyValue.KeyComparator
Parameters:
leftKey - the previous block's real stop key usually
rightKey - the current block's real start key usually
Returns:
newKey: the newly generated faked key

compareRowid

protected int compareRowid(byte[] left,
                           int loffset,
                           int llength,
                           byte[] right,
                           int roffset,
                           int rlength)


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.