|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.QueryMatcher
public class QueryMatcher
This is the primary class used to process KeyValues during a Get or Scan operation.
It encapsulates the handling of the column and version input parameters to
the query through a ColumnTracker
.
Deletes are handled using the DeleteTracker
.
All other query parameters are accessed from the client-specified Get.
The primary method used is match(org.apache.hadoop.hbase.KeyValue)
with the current KeyValue. It will
return a QueryMatcher.MatchCode
, deletes,
versions,
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 byte[] |
row
Row the query is on |
protected KeyValue |
startKey
Key to seek to in memstore and StoreFiles |
protected TimeRange |
tr
TimeRange the query is for |
Constructor Summary | |
---|---|
protected |
QueryMatcher()
|
|
QueryMatcher(Get get,
byte[] family,
NavigableSet<byte[]> columns,
long ttl,
KeyValue.KeyComparator rowComparator,
int maxVersions)
Constructs a QueryMatcher for a Get. |
|
QueryMatcher(QueryMatcher matcher,
byte[] row)
Constructs a copy of an existing QueryMatcher with a new row. |
Method Summary | |
---|---|
ColumnTracker |
getColumnTracker()
|
DeleteTracker |
getDeleteTracker()
|
long |
getOldestStamp()
|
KeyValue.KeyComparator |
getRowComparator()
|
ColumnCount |
getSeekColumn()
If matcher returns SEEK_NEXT_COL you may be able to get a hint of the next column to seek to - call this. |
KeyValue |
getStartKey()
|
TimeRange |
getTimeRange()
|
protected boolean |
isDelete(byte type)
|
boolean |
isDone()
|
protected boolean |
isExpired(long timestamp)
|
org.apache.hadoop.hbase.regionserver.QueryMatcher.MatchCode |
match(KeyValue kv)
Main method for ColumnMatcher. |
void |
reset()
Resets the current columns and deletes |
void |
setRow(byte[] row)
Set current row |
void |
update()
Called after reading each section (memstore, snapshot, storefiles). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DeleteTracker deletes
protected ColumnTracker columns
protected KeyValue startKey
protected byte[] row
protected TimeRange tr
protected long oldestStamp
protected Filter filter
Constructor Detail |
---|
public QueryMatcher(Get get, byte[] family, NavigableSet<byte[]> columns, long ttl, KeyValue.KeyComparator rowComparator, int maxVersions)
get
- family
- columns
- ttl
- rowComparator
- protected QueryMatcher()
public QueryMatcher(QueryMatcher matcher, byte[] row)
matcher
- row
- Method Detail |
---|
public org.apache.hadoop.hbase.regionserver.QueryMatcher.MatchCode match(KeyValue kv)
Determines whether the specified KeyValue should be included in the result or not.
Contains additional language to early-out of the current file or to return immediately.
Things to be checked:
kv
- KeyValue to check
protected boolean isDelete(byte type)
protected boolean isExpired(long timestamp)
public ColumnCount getSeekColumn()
public void update()
This method will update the internal structures to be accurate for the next section.
public void reset()
public void setRow(byte[] row)
row
- public KeyValue getStartKey()
public TimeRange getTimeRange()
public long getOldestStamp()
public KeyValue.KeyComparator getRowComparator()
public ColumnTracker getColumnTracker()
public DeleteTracker getDeleteTracker()
public boolean isDone()
true
when done.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |