@InterfaceAudience.Private public interface ColumnTracker
Currently there are two different types of Store/Family-level queries.
ExplicitColumnTracker
is used when the query specifies
one or more column qualifiers to return in the family.ScanWildcardColumnTracker
is used when no columns are
explicitly specified.
This class is utilized by ScanQueryMatcher
mainly through two methods:
checkColumn(byte[], int, int, byte)
is called when a Put satisfies all other
conditions of the query.getNextRowOrNextColumn(byte[], int, int)
is called whenever ScanQueryMatcher
believes that the current column should be skipped (by timestamp, filter etc.)
These two methods returns a
ScanQueryMatcher.MatchCode
to define what action should be taken.
This class is NOT thread-safe as queries are never multi-threaded
Modifier and Type | Method and Description |
---|---|
ScanQueryMatcher.MatchCode |
checkColumn(byte[] bytes,
int offset,
int length,
byte type)
Checks if the column is present in the list of requested columns by returning the match code
instance.
|
ScanQueryMatcher.MatchCode |
checkVersions(byte[] bytes,
int offset,
int length,
long ttl,
byte type,
boolean ignoreCount)
Keeps track of the number of versions for the columns asked for.
|
boolean |
done() |
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
|
ScanQueryMatcher.MatchCode checkColumn(byte[] bytes, int offset, int length, byte type) throws IOException
checkVersions(byte[], int, int, long, byte, boolean)
method based on the return type (INCLUDE) of this method. The values that can be returned by
this method are ScanQueryMatcher.MatchCode.INCLUDE
, ScanQueryMatcher.MatchCode.SEEK_NEXT_COL
and
ScanQueryMatcher.MatchCode.SEEK_NEXT_ROW
.bytes
- offset
- length
- type
- The type of the KeyValueIOException
- in case there is an internal consistency problem caused by a data
corruption.ScanQueryMatcher.MatchCode checkVersions(byte[] bytes, int offset, int length, long ttl, byte type, boolean ignoreCount) throws IOException
checkColumn(byte[], int, int, byte)
method. The enum values returned by this method
are ScanQueryMatcher.MatchCode.SKIP
, ScanQueryMatcher.MatchCode.INCLUDE
,
ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL
and ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_ROW
.
Implementations which include all the columns could just return ScanQueryMatcher.MatchCode.INCLUDE
in
the checkColumn(byte[], int, int, byte)
method and perform all the operations in this
checkVersions method.type
- the type of the key value (Put/Delete)ttl
- The timeToLive to enforce.ignoreCount
- 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.)IOException
- in case there is an internal consistency problem caused by a data
corruption.void reset()
boolean done()
true
when done.ColumnCount getColumnHint()
ScanQueryMatcher.MatchCode getNextRowOrNextColumn(byte[] bytes, int offset, int qualLength)
boolean isDone(long timestamp)
timestamp
- true
to early out based on timestamp.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.