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
FieldsModifier and TypeFieldDescriptionprivate intprivate ExtendedCellprotected final Filterprotected final booleanprotected final byte[]protected final TimeRangeprivate final intFields inherited from class org.apache.hadoop.hbase.regionserver.querymatcher.ScanQueryMatcher
columns, currentRow, now, oldestUnexpiredTS, rowComparator, startKey -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUserScanQueryMatcher(Scan scan, ScanInfo scanInfo, ColumnTracker columns, boolean hasNullColumn, long oldestUnexpiredTS, long now) -
Method Summary
Modifier and TypeMethodDescriptionvoidThe action that needs to be performed beforeShipper.shipped()is performedstatic UserScanQueryMatchercreate(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, long oldestUnexpiredTS, long now, RegionCoprocessorHost regionCoprocessorHost) private static ExtendedCellcreateStartKey(Scan scan, ScanInfo scanInfo) Returns the FiltergetNextKeyHint(ExtendedCell cell) Delegate toFilter.getNextCellHint(Cell).booleanReturns whether there is an null column in the queryprotected abstract booleanisGet()booleanprotected final ScanQueryMatcher.MatchCodematchColumn(ExtendedCell cell, long timestamp, byte typeByte) private final ScanQueryMatcher.MatchCodemergeFilterResponse(ExtendedCell cell, ScanQueryMatcher.MatchCode matchCode, Filter.ReturnCode filterResponse) Call this when scan has filter.booleanprotected abstract booleanmoreRowsMayExistsAfter(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:ScanQueryMatcherReturns whether there is an null column in the query- Specified by:
hasNullColumnInQueryin classScanQueryMatcher
-
isUserScan
- Specified by:
isUserScanin classScanQueryMatcher
-
getFilter
Description copied from class:ScanQueryMatcherReturns the Filter- Specified by:
getFilterin classScanQueryMatcher
-
getNextKeyHint
Description copied from class:ScanQueryMatcherDelegate toFilter.getNextCellHint(Cell). If no filter, returnnull.- Specified by:
getNextKeyHintin classScanQueryMatcher- Throws:
IOException
-
beforeShipped
Description copied from interface:ShipperListenerThe action that needs to be performed beforeShipper.shipped()is performed- Specified by:
beforeShippedin interfaceShipperListener- Overrides:
beforeShippedin classScanQueryMatcher- Throws:
IOException
-
matchColumn
protected final ScanQueryMatcher.MatchCode matchColumn(ExtendedCell cell, long timestamp, byte typeByte) throws IOException - Throws:
IOException
-
mergeFilterResponse
private final ScanQueryMatcher.MatchCode mergeFilterResponse(ExtendedCell 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:
moreRowsMayExistAfterin classScanQueryMatcher- Returns:
- Returns false if we know there are no more rows to be scanned (We've reached the
stopRowor we are scanning on row only because this Scan is for a Get, etc.
-