org.apache.hadoop.hbase.regionserver
Class ScanQueryMatcher

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.ScanQueryMatcher

public class ScanQueryMatcher
extends Object

A query matcher that is specifically designed for the scan case.


Nested Class Summary
static class ScanQueryMatcher.MatchCode
          match(org.apache.hadoop.hbase.KeyValue) return codes.
 
Field Summary
protected  ColumnTracker columns
          Keeps track of columns and versions
protected  DeleteTracker deletes
          Keeps track of deletes
protected  Filter filter
           
protected  long oldestStamp
          Oldest allowed version stamp for TTL enforcement
protected  boolean retainDeletesInOutput
           
protected  byte[] row
          Row the query is on
protected  KeyValue startKey
          Key to seek to in memstore and StoreFiles
protected  TimeRange tr
           
 
Constructor Summary
ScanQueryMatcher(Scan scan, byte[] family, NavigableSet<byte[]> columns, long ttl, KeyValue.KeyComparator rowComparator, int maxVersions)
           
ScanQueryMatcher(Scan scan, byte[] family, NavigableSet<byte[]> columns, long ttl, KeyValue.KeyComparator rowComparator, int maxVersions, boolean retainDeletesInOutput)
          Constructs a ScanQueryMatcher for a Scan.
 
Method Summary
 KeyValue getKeyForNextColumn(KeyValue kv)
           
 KeyValue getKeyForNextRow(KeyValue kv)
           
 KeyValue getNextKeyHint(KeyValue kv)
           
 ScanQueryMatcher.MatchCode getNextRowOrNextColumn(byte[] bytes, int offset, int qualLength)
           
 KeyValue getStartKey()
           
protected  boolean isDelete(byte type)
           
protected  boolean isExpired(long timestamp)
           
 ScanQueryMatcher.MatchCode match(KeyValue kv)
          Determines if the caller should do one of several things: - seek/skip to the next row (MatchCode.SEEK_NEXT_ROW) - seek/skip to the next column (MatchCode.SEEK_NEXT_COL) - include the current KeyValue (MatchCode.INCLUDE) - ignore the current KeyValue (MatchCode.SKIP) - got to the next row (MatchCode.DONE)
 boolean moreRowsMayExistAfter(KeyValue kv)
           
 void reset()
           
 void setRow(byte[] row)
          Set current row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tr

protected TimeRange tr

filter

protected Filter filter

deletes

protected DeleteTracker deletes
Keeps track of deletes


retainDeletesInOutput

protected boolean retainDeletesInOutput

columns

protected ColumnTracker columns
Keeps track of columns and versions


startKey

protected KeyValue startKey
Key to seek to in memstore and StoreFiles


oldestStamp

protected long oldestStamp
Oldest allowed version stamp for TTL enforcement


row

protected byte[] row
Row the query is on

Constructor Detail

ScanQueryMatcher

public ScanQueryMatcher(Scan scan,
                        byte[] family,
                        NavigableSet<byte[]> columns,
                        long ttl,
                        KeyValue.KeyComparator rowComparator,
                        int maxVersions,
                        boolean retainDeletesInOutput)
Constructs a ScanQueryMatcher for a Scan.

Parameters:
scan -
family -
columns -
ttl -
rowComparator -

ScanQueryMatcher

public ScanQueryMatcher(Scan scan,
                        byte[] family,
                        NavigableSet<byte[]> columns,
                        long ttl,
                        KeyValue.KeyComparator rowComparator,
                        int maxVersions)
Method Detail

match

public ScanQueryMatcher.MatchCode match(KeyValue kv)
Determines if the caller should do one of several things: - seek/skip to the next row (MatchCode.SEEK_NEXT_ROW) - seek/skip to the next column (MatchCode.SEEK_NEXT_COL) - include the current KeyValue (MatchCode.INCLUDE) - ignore the current KeyValue (MatchCode.SKIP) - got to the next row (MatchCode.DONE)

Parameters:
kv - KeyValue to check
Returns:
The match code instance.

getNextRowOrNextColumn

public ScanQueryMatcher.MatchCode getNextRowOrNextColumn(byte[] bytes,
                                                         int offset,
                                                         int qualLength)

moreRowsMayExistAfter

public boolean moreRowsMayExistAfter(KeyValue kv)

setRow

public void setRow(byte[] row)
Set current row

Parameters:
row -

reset

public void reset()

isDelete

protected boolean isDelete(byte type)

isExpired

protected boolean isExpired(long timestamp)

getStartKey

public KeyValue getStartKey()
Returns:
the start key

getNextKeyHint

public KeyValue getNextKeyHint(KeyValue kv)

getKeyForNextColumn

public KeyValue getKeyForNextColumn(KeyValue kv)

getKeyForNextRow

public KeyValue getKeyForNextRow(KeyValue kv)


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