|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.ExplicitColumnTracker
public class ExplicitColumnTracker
This class is used for the tracking and enforcement of columns and numbers
of versions during the course of a Get or Scan operation, when explicit
column qualifiers have been asked for in the query.
With a little magic (see ScanQueryMatcher
), we can use this matcher
for both scans and gets. The main difference is 'next' and 'done' collapse
for the scan case (since we see all columns in order), and we only reset
between rows.
This class is utilized by ScanQueryMatcher
through two methods:
checkColumn(byte[], int, int, long, boolean)
is called when a Put satisfies all other
conditions of the query. This method returns a ScanQueryMatcher.MatchCode
to define
what action should be taken.
update()
is called at the end of every StoreFile or memstore.
This class is NOT thread-safe as queries are never multi-threaded
Constructor Summary | |
---|---|
ExplicitColumnTracker(NavigableSet<byte[]> columns,
int minVersions,
int maxVersions,
long ttl)
Default constructor. |
Method Summary | |
---|---|
ScanQueryMatcher.MatchCode |
checkColumn(byte[] bytes,
int offset,
int length,
long timestamp,
boolean ignoreCount)
Checks against the parameters of the query and the columns which have already been processed by this query. |
boolean |
done()
Done when there are no more columns to match against. |
void |
doneWithColumn(byte[] bytes,
int offset,
int length)
This method is used to inform the column tracker that we are done with this column. |
ColumnCount |
getColumnHint()
Used by matcher and scan/get to get a hint of the next column to seek to after checkColumn() returns SKIP. |
ScanQueryMatcher.MatchCode |
getNextRowOrNextColumn(byte[] bytes,
int offset,
int qualLength)
Retrieve the MatchCode for the next row or column |
boolean |
isDone(long timestamp)
Give the tracker a chance to declare it's done based on only the timestamp to allow an early out. |
void |
reset()
Resets the Matcher |
void |
update()
Called at the end of every StoreFile or memstore. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExplicitColumnTracker(NavigableSet<byte[]> columns, int minVersions, int maxVersions, long ttl)
columns
- columns specified user in queryminVersions
- minimum number of versions to keepmaxVersions
- maximum versions to return per columnttl
- The timeToLive to enforceMethod Detail |
---|
public boolean done()
done
in interface ColumnTracker
true
when done.public ColumnCount getColumnHint()
ColumnTracker
getColumnHint
in interface ColumnTracker
public ScanQueryMatcher.MatchCode checkColumn(byte[] bytes, int offset, int length, long timestamp, boolean ignoreCount)
checkColumn
in interface ColumnTracker
bytes
- KeyValue bufferoffset
- offset to the start of the qualifierlength
- length of the qualifiertimestamp
- timestamp of the key being checkedignoreCount
- indicates if the KV needs to be excluded while counting
(used during compactions. We only count KV's that are older than all the
scanners' read points.)
public void update()
update
in interface ColumnTracker
public void reset()
ColumnTracker
reset
in interface ColumnTracker
public void doneWithColumn(byte[] bytes, int offset, int length)
bytes
- offset
- length
- public ScanQueryMatcher.MatchCode getNextRowOrNextColumn(byte[] bytes, int offset, int qualLength)
ColumnTracker
getNextRowOrNextColumn
in interface ColumnTracker
public boolean isDone(long timestamp)
ColumnTracker
isDone
in interface ColumnTracker
true
to early out based on timestamp.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |