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 maxReadPointToTrackVersions
          readPoint over which the KVs are unconditionally included
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 minVersions, int maxVersions)
           
ScanQueryMatcher(Scan scan, byte[] family, NavigableSet<byte[]> columns, long ttl, KeyValue.KeyComparator rowComparator, int minVersions, int maxVersions, boolean retainDeletesInOutput, long readPointToUse)
          Constructs a ScanQueryMatcher for a Scan.
 
Method Summary
 KeyValue getKeyForNextColumn(KeyValue kv)
           
 KeyValue getKeyForNextRow(KeyValue kv)
           
 KeyValue getNextKeyHint(KeyValue kv)
           
 KeyValue getStartKey()
           
protected  boolean isDelete(byte type)
           
 boolean isExactColumnQuery()
           
 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


row

protected byte[] row
Row the query is on


maxReadPointToTrackVersions

protected long maxReadPointToTrackVersions
readPoint over which the KVs are unconditionally included

Constructor Detail

ScanQueryMatcher

public ScanQueryMatcher(Scan scan,
                        byte[] family,
                        NavigableSet<byte[]> columns,
                        long ttl,
                        KeyValue.KeyComparator rowComparator,
                        int minVersions,
                        int maxVersions,
                        boolean retainDeletesInOutput,
                        long readPointToUse)
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 minVersions,
                        int maxVersions)

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)
                                 throws IOException
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.
Throws:
IOException - in case there is an internal consistency problem caused by a data corruption.

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)

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)

isExactColumnQuery

public boolean isExactColumnQuery()


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