@InterfaceAudience.Private public class ScanQueryMatcher extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ScanQueryMatcher.MatchCode
match(org.apache.hadoop.hbase.Cell) return codes. |
Modifier and Type | Field and Description |
---|---|
private ColumnTracker |
columns
Keeps track of columns and versions
|
private DeleteTracker |
deletes
Keeps track of deletes
|
private byte[] |
dropDeletesFromRow |
private byte[] |
dropDeletesToRow |
private long |
earliestPutTs
Oldest put in any of the involved store files
Used to decide whether it is ok to delete
family delete marker of this store keeps
deleted KVs.
|
private Filter |
filter |
private boolean |
hasNullColumn
This variable shows whether there is an null column in the query.
|
private boolean |
isReversed |
private boolean |
isUserScan |
private KeepDeletedCells |
keepDeletedCells
whether to return deleted rows
|
protected long |
maxReadPointToTrackVersions
readPoint over which the KVs are unconditionally included
|
private long |
now |
private long |
oldestUnexpiredTS
The oldest timestamp we are interested in, based on TTL
|
private RegionCoprocessorHost |
regionCoprocessorHost |
private boolean |
retainDeletesInOutput
whether to retain delete markers
|
(package private) byte[] |
row
Row the query is on
|
private KeyValue.KVComparator |
rowComparator
Row comparator for the region this query is for
|
(package private) short |
rowLength |
(package private) int |
rowOffset |
private boolean |
seePastDeleteMarkers
whether time range queries can see rows "behind" a delete
|
private Cell |
startKey
Key to seek to in memstore and StoreFiles
|
private boolean |
stickyNextRow |
private byte[] |
stopRow |
private long |
timeToPurgeDeletes |
private TimeRange |
tr |
private long |
ttl |
Constructor and Description |
---|
ScanQueryMatcher(Scan scan,
ScanInfo scanInfo,
NavigableSet<byte[]> columns,
long oldestUnexpiredTS,
long now) |
ScanQueryMatcher(Scan scan,
ScanInfo scanInfo,
NavigableSet<byte[]> columns,
long readPointToUse,
long earliestPutTs,
long oldestUnexpiredTS,
long now,
byte[] dropDeletesFromRow,
byte[] dropDeletesToRow,
RegionCoprocessorHost regionCoprocessorHost)
Construct a QueryMatcher for a scan that drop deletes from a limited range of rows.
|
ScanQueryMatcher(Scan scan,
ScanInfo scanInfo,
NavigableSet<byte[]> columns,
ScanType scanType,
long readPointToUse,
long earliestPutTs,
long oldestUnexpiredTS,
long now,
RegionCoprocessorHost regionCoprocessorHost)
Construct a QueryMatcher for a scan
|
Modifier and Type | Method and Description |
---|---|
(package private) static ScanQueryMatcher.MatchCode |
checkColumn(ColumnTracker columnTracker,
byte[] bytes,
int offset,
int length,
long ttl,
byte type,
boolean ignoreCount) |
private void |
checkPartialDropDeleteRange(byte[] row,
int offset,
short length)
Handle partial-drop-deletes.
|
int |
compareKeyForNextColumn(Cell nextIndexed,
Cell kv) |
int |
compareKeyForNextRow(Cell nextIndexed,
Cell kv) |
private static Cell |
createNextOnRowCol(Cell cell) |
private static Cell |
createNextOnRowCol(Cell cell,
long ts,
byte type) |
(package private) Filter |
getFilter() |
Cell |
getKeyForNextColumn(Cell kv) |
Cell |
getKeyForNextRow(Cell kv) |
Cell |
getNextKeyHint(Cell kv) |
Cell |
getStartKey() |
boolean |
hasNullColumnInQuery() |
private DeleteTracker |
instantiateDeleteTracker() |
ScanQueryMatcher.MatchCode |
match(Cell cell)
Determines if the caller should do one of several things:
- seek/skip to the next row (MatchCode.SEEK_NEXT_ROW)
- seek/skip to the next column (MatchCode.SEEK_NEXT_COL)
- include the current KeyValue (MatchCode.INCLUDE)
- ignore the current KeyValue (MatchCode.SKIP)
- got to the next row (MatchCode.DONE)
|
boolean |
moreRowsMayExistAfter(Cell kv) |
void |
reset() |
void |
setRow(byte[] row,
int offset,
short length)
Set current row
|
private boolean stickyNextRow
private final byte[] stopRow
private final TimeRange tr
private final Filter filter
private final DeleteTracker deletes
private boolean retainDeletesInOutput
private final KeepDeletedCells keepDeletedCells
private final boolean seePastDeleteMarkers
private final ColumnTracker columns
private final Cell startKey
private final KeyValue.KVComparator rowComparator
byte[] row
int rowOffset
short rowLength
private final long earliestPutTs
private final long ttl
private final long oldestUnexpiredTS
private final long now
protected long maxReadPointToTrackVersions
private byte[] dropDeletesFromRow
private byte[] dropDeletesToRow
private boolean hasNullColumn
private RegionCoprocessorHost regionCoprocessorHost
private final long timeToPurgeDeletes
private final boolean isUserScan
private final boolean isReversed
public ScanQueryMatcher(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, ScanType scanType, long readPointToUse, long earliestPutTs, long oldestUnexpiredTS, long now, RegionCoprocessorHost regionCoprocessorHost) throws IOException
scan
- scanInfo
- The store's immutable scan infocolumns
- scanType
- Type of the scanearliestPutTs
- Earliest put seen in any of the store files.oldestUnexpiredTS
- the oldest timestamp we are interested in,
based on TTLregionCoprocessorHost
- IOException
public ScanQueryMatcher(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, long readPointToUse, long earliestPutTs, long oldestUnexpiredTS, long now, byte[] dropDeletesFromRow, byte[] dropDeletesToRow, RegionCoprocessorHost regionCoprocessorHost) throws IOException
scan
- scanInfo
- The store's immutable scan infocolumns
- earliestPutTs
- Earliest put seen in any of the store files.oldestUnexpiredTS
- the oldest timestamp we are interested in, based on TTLnow
- the current server timedropDeletesFromRow
- The inclusive left bound of the range; can be EMPTY_START_ROW.dropDeletesToRow
- The exclusive right bound of the range; can be EMPTY_END_ROW.regionCoprocessorHost
- IOException
ScanQueryMatcher(Scan scan, ScanInfo scanInfo, NavigableSet<byte[]> columns, long oldestUnexpiredTS, long now) throws IOException
IOException
private DeleteTracker instantiateDeleteTracker() throws IOException
IOException
public boolean hasNullColumnInQuery()
public ScanQueryMatcher.MatchCode match(Cell cell) throws IOException
cell
- KeyValue to checkIOException
- in case there is an internal consistency problem
caused by a data corruption.private void checkPartialDropDeleteRange(byte[] row, int offset, short length)
public boolean moreRowsMayExistAfter(Cell kv)
public void setRow(byte[] row, int offset, short length)
row
- public void reset()
public Cell getStartKey()
Filter getFilter()
public Cell getNextKeyHint(Cell kv) throws IOException
IOException
public int compareKeyForNextRow(Cell nextIndexed, Cell kv)
nextIndexed
- the key of the next entry in the block index (if any)kv
- The Cell we're using to calculate the seek keypublic int compareKeyForNextColumn(Cell nextIndexed, Cell kv)
nextIndexed
- the key of the next entry in the block index (if any)kv
- The Cell we're using to calculate the seek keystatic ScanQueryMatcher.MatchCode checkColumn(ColumnTracker columnTracker, byte[] bytes, int offset, int length, long ttl, byte type, boolean ignoreCount) throws IOException
IOException
private static Cell createNextOnRowCol(Cell cell)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.