Class UserScanQueryMatcher
java.lang.Object
org.apache.hadoop.hbase.regionserver.querymatcher.ScanQueryMatcher
org.apache.hadoop.hbase.regionserver.querymatcher.UserScanQueryMatcher
- All Implemented Interfaces:
ShipperListener
- Direct Known Subclasses:
NormalUserScanQueryMatcher
,RawScanQueryMatcher
Query matcher for user scan.
We do not consider mvcc here because
StoreFileScanner
and
SegmentScanner
will only return a cell whose mvcc is
less than or equal to given read point. For
IsolationLevel.READ_UNCOMMITTED
, we just set the read
point to Long.MAX_VALUE
, i.e. still do not need to consider it.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.querymatcher.ScanQueryMatcher
ScanQueryMatcher.MatchCode
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private Cell
protected final Filter
protected final boolean
protected final byte[]
protected final TimeRange
private final int
Fields inherited from class org.apache.hadoop.hbase.regionserver.querymatcher.ScanQueryMatcher
columns, currentRow, now, oldestUnexpiredTS, rowComparator, startKey
-
Constructor Summary
ModifierConstructorDescriptionprotected
UserScanQueryMatcher
(Scan scan, ScanInfo scanInfo, ColumnTracker columns, boolean hasNullColumn, long oldestUnexpiredTS, long now) -
Method Summary
Modifier and TypeMethodDescriptionvoid
The action that needs to be performed beforeShipper.shipped()
is performedstatic UserScanQueryMatcher
create
(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, long oldestUnexpiredTS, long now, RegionCoprocessorHost regionCoprocessorHost) private static Cell
createStartKey
(Scan scan, ScanInfo scanInfo) Returns the FiltergetNextKeyHint
(Cell cell) Delegate toFilter.getNextCellHint(Cell)
.boolean
Returns whether there is an null column in the queryprotected abstract boolean
isGet()
boolean
protected final ScanQueryMatcher.MatchCode
matchColumn
(Cell cell, long timestamp, byte typeByte) private final ScanQueryMatcher.MatchCode
mergeFilterResponse
(Cell cell, ScanQueryMatcher.MatchCode matchCode, Filter.ReturnCode filterResponse) Call this when scan has filter.boolean
moreRowsMayExistAfter
(Cell cell) protected abstract boolean
moreRowsMayExistsAfter
(int cmpToStopRow) Methods inherited from class org.apache.hadoop.hbase.regionserver.querymatcher.ScanQueryMatcher
checkColumn, checkDeleted, clearCurrentRow, compareKeyForNextColumn, compareKeyForNextRow, createStartKeyFromRow, currentRow, getKeyForNextColumn, getStartKey, getTrackers, match, preCheck, reset, setToNewRow
-
Field Details
-
hasNullColumn
-
filter
-
stopRow
-
tr
-
versionsAfterFilter
-
count
-
curColCell
-
-
Constructor Details
-
UserScanQueryMatcher
protected UserScanQueryMatcher(Scan scan, ScanInfo scanInfo, ColumnTracker columns, boolean hasNullColumn, long oldestUnexpiredTS, long now)
-
-
Method Details
-
createStartKey
-
hasNullColumnInQuery
Description copied from class:ScanQueryMatcher
Returns whether there is an null column in the query- Specified by:
hasNullColumnInQuery
in classScanQueryMatcher
-
isUserScan
- Specified by:
isUserScan
in classScanQueryMatcher
-
getFilter
Description copied from class:ScanQueryMatcher
Returns the Filter- Specified by:
getFilter
in classScanQueryMatcher
-
getNextKeyHint
Description copied from class:ScanQueryMatcher
Delegate toFilter.getNextCellHint(Cell)
. If no filter, returnnull
.- Specified by:
getNextKeyHint
in classScanQueryMatcher
- Throws:
IOException
-
beforeShipped
Description copied from interface:ShipperListener
The action that needs to be performed beforeShipper.shipped()
is performed- Specified by:
beforeShipped
in interfaceShipperListener
- Overrides:
beforeShipped
in classScanQueryMatcher
- Throws:
IOException
-
matchColumn
protected final ScanQueryMatcher.MatchCode matchColumn(Cell cell, long timestamp, byte typeByte) throws IOException - Throws:
IOException
-
mergeFilterResponse
private final ScanQueryMatcher.MatchCode mergeFilterResponse(Cell cell, ScanQueryMatcher.MatchCode matchCode, Filter.ReturnCode filterResponse) Call this when scan has filter. Decide the desired behavior by checkVersions's MatchCode and filterCell's ReturnCode. Cell may be skipped by filter, so the column versions in result may be less than user need. It need to check versions again when filter and columnTracker both include the cell.
ColumnChecker FilterResponse Desired behavior INCLUDE SKIP SKIP INCLUDE NEXT_COL SEEK_NEXT_COL or SEEK_NEXT_ROW INCLUDE NEXT_ROW SEEK_NEXT_ROW INCLUDE SEEK_NEXT_USING_HINT SEEK_NEXT_USING_HINT INCLUDE INCLUDE INCLUDE INCLUDE INCLUDE_AND_NEXT_COL INCLUDE_AND_SEEK_NEXT_COL INCLUDE INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_COL SKIP SEEK_NEXT_COL INCLUDE_AND_SEEK_NEXT_COL NEXT_COL SEEK_NEXT_COL or SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_COL NEXT_ROW SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_COL SEEK_NEXT_USING_HINT SEEK_NEXT_USING_HINT INCLUDE_AND_SEEK_NEXT_COL INCLUDE INCLUDE_AND_SEEK_NEXT_COL INCLUDE_AND_SEEK_NEXT_COL INCLUDE_AND_NEXT_COL INCLUDE_AND_SEEK_NEXT_COL INCLUDE_AND_SEEK_NEXT_COL INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW SKIP SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW NEXT_COL SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW NEXT_ROW SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW SEEK_NEXT_USING_HINT SEEK_NEXT_USING_HINT INCLUDE_AND_SEEK_NEXT_ROW INCLUDE INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_NEXT_COL INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW INCLUDE_AND_SEEK_NEXT_ROW
-
isGet
-
moreRowsMayExistsAfter
-
moreRowsMayExistAfter
- Specified by:
moreRowsMayExistAfter
in classScanQueryMatcher
- Returns:
- Returns false if we know there are no more rows to be scanned (We've reached the
stopRow
or we are scanning on row only because this Scan is for a Get, etc.
-