@InterfaceAudience.Private public interface ColumnTracker extends ShipperListener
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(org.apache.hadoop.hbase.Cell, byte)
is called when a Put satisfies all other conditions of the query.getNextRowOrNextColumn(org.apache.hadoop.hbase.Cell)
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(Cell cell,
byte type)
Checks if the column is present in the list of requested columns by returning the match code
instance.
|
ScanQueryMatcher.MatchCode |
checkVersions(Cell cell,
long timestamp,
byte type,
boolean ignoreCount)
Keeps track of the number of versions for the columns asked for.
|
boolean |
done()
Returns
true when done. |
default void |
doneWithColumn(Cell cell)
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(Cell cell)
Retrieve the MatchCode for the next row or column n
|
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
|
beforeShipped
ScanQueryMatcher.MatchCode checkColumn(Cell cell, byte type) throws IOException
checkVersions(Cell, 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
.cell
- a cell with the column to match againsttype
- The type of the CellIOException
- in case there is an internal consistency problem caused by a data
corruption.ScanQueryMatcher.MatchCode checkVersions(Cell cell, long timestamp, byte type, boolean ignoreCount) throws IOException
checkColumn(Cell, 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(Cell, byte)
method and
perform all the operations in this checkVersions method.cell
- a cell with the column to match againsttimestamp
- The timestamp of the cell.type
- the type of the key value (Put/Delete)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(Cell cell)
boolean isDone(long timestamp)
true
to early out based on timestamp.default void doneWithColumn(Cell cell)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.