org.apache.hadoop.hbase.regionserver
Class ScanQueryMatcher

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

@InterfaceAudience.Private
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  long maxReadPointToTrackVersions
          readPoint over which the KVs are unconditionally included
 
Constructor Summary
ScanQueryMatcher(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, long readPointToUse, long earliestPutTs, long oldestUnexpiredTS, byte[] dropDeletesFromRow, byte[] dropDeletesToRow)
          Construct a QueryMatcher for a scan that drop deletes from a limited range of rows.
ScanQueryMatcher(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, ScanType scanType, long readPointToUse, long earliestPutTs, long oldestUnexpiredTS)
          Construct a QueryMatcher for a scan
 
Method Summary
 KeyValue getKeyForNextColumn(KeyValue kv)
           
 KeyValue getKeyForNextRow(KeyValue kv)
           
 KeyValue getNextKeyHint(KeyValue kv)
           
 KeyValue getStartKey()
           
 boolean hasNullColumnInQuery()
           
 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, int offset, short length)
          Set current row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxReadPointToTrackVersions

protected long maxReadPointToTrackVersions
readPoint over which the KVs are unconditionally included

Constructor Detail

ScanQueryMatcher

public ScanQueryMatcher(Scan scan,
                        ScanInfo scanInfo,
                        NavigableSet<byte[]> columns,
                        ScanType scanType,
                        long readPointToUse,
                        long earliestPutTs,
                        long oldestUnexpiredTS)
Construct a QueryMatcher for a scan

Parameters:
scan -
scanInfo - The store's immutable scan info
columns -
scanType - Type of the scan
earliestPutTs - Earliest put seen in any of the store files.
oldestUnexpiredTS - the oldest timestamp we are interested in, based on TTL

ScanQueryMatcher

public ScanQueryMatcher(Scan scan,
                        ScanInfo scanInfo,
                        NavigableSet<byte[]> columns,
                        long readPointToUse,
                        long earliestPutTs,
                        long oldestUnexpiredTS,
                        byte[] dropDeletesFromRow,
                        byte[] dropDeletesToRow)
Construct a QueryMatcher for a scan that drop deletes from a limited range of rows.

Parameters:
scan -
scanInfo - The store's immutable scan info
columns -
earliestPutTs - Earliest put seen in any of the store files.
oldestUnexpiredTS - the oldest timestamp we are interested in, based on TTL
dropDeletesFromRow - The inclusive left bound of the range; can be EMPTY_START_ROW.
dropDeletesToRow - The exclusive right bound of the range; can be EMPTY_END_ROW.
Method Detail

hasNullColumnInQuery

public boolean hasNullColumnInQuery()
Returns:
whether there is an null column in the query

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,
                   int offset,
                   short length)
Set current row

Parameters:
row -

reset

public void reset()

getStartKey

public KeyValue getStartKey()
Returns:
the start key

getNextKeyHint

public KeyValue getNextKeyHint(KeyValue kv)
                        throws IOException
Throws:
IOException

getKeyForNextColumn

public KeyValue getKeyForNextColumn(KeyValue kv)

getKeyForNextRow

public KeyValue getKeyForNextRow(KeyValue kv)


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