@InterfaceAudience.Private public class ScanWildcardColumnTracker extends Object implements ColumnTracker
Modifier and Type | Field and Description |
---|---|
private Cell |
columnCell |
private CellComparator |
comparator |
private int |
currentCount |
private long |
latestTSOfCurrentColumn |
private byte |
latestTypeOfCurrentColumn |
private int |
maxVersions |
private int |
minVersions |
private long |
oldestStamp |
Constructor and Description |
---|
ScanWildcardColumnTracker(int minVersion,
int maxVersion,
long oldestUnexpiredTS,
CellComparator comparator)
Return maxVersions of every row.
|
Modifier and Type | Method and Description |
---|---|
void |
beforeShipped()
The action that needs to be performed before
Shipper.shipped() is performed n |
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.
|
private ScanQueryMatcher.MatchCode |
checkVersion(byte type,
long timestamp)
Check whether this version should be retained.
|
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()
We can never know a-priori if we are done, so always return false.
|
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.
|
private boolean |
isExpired(long timestamp) |
void |
reset()
Resets the Matcher
|
private void |
resetCell(Cell columnCell) |
private void |
resetTSAndType() |
private boolean |
sameAsPreviousTSAndType(long timestamp,
byte type) |
private void |
setTSAndType(long timestamp,
byte type) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doneWithColumn
private Cell columnCell
private int currentCount
private final int maxVersions
private final int minVersions
private long latestTSOfCurrentColumn
private byte latestTypeOfCurrentColumn
private long oldestStamp
private final CellComparator comparator
public ScanWildcardColumnTracker(int minVersion, int maxVersion, long oldestUnexpiredTS, CellComparator comparator)
minVersion
- Minimum number of versions to keepmaxVersion
- Maximum number of versions to returnoldestUnexpiredTS
- oldest timestamp that has not expired according to the TTL.comparator
- used to compare the qualifier of cellpublic ScanQueryMatcher.MatchCode checkColumn(Cell cell, byte type) throws IOException
ColumnTracker.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
. This receives puts *and* deletes.checkColumn
in interface ColumnTracker
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.public ScanQueryMatcher.MatchCode checkVersions(Cell cell, long timestamp, byte type, boolean ignoreCount) throws IOException
ColumnTracker.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 ColumnTracker.checkColumn(Cell, byte)
method and
perform all the operations in this checkVersions method. This receives puts *and* deletes. Deletes do not count as a version, but rather
take the version of the previous put (so eventually all but the last can be reclaimed).checkVersions
in interface ColumnTracker
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.private ScanQueryMatcher.MatchCode checkVersion(byte type, long timestamp)
public void reset()
ColumnTracker
reset
in interface ColumnTracker
private void resetTSAndType()
private void setTSAndType(long timestamp, byte type)
private boolean sameAsPreviousTSAndType(long timestamp, byte type)
private boolean isExpired(long timestamp)
public ColumnCount getColumnHint()
getColumnHint
in interface ColumnTracker
public boolean done()
done
in interface ColumnTracker
public ScanQueryMatcher.MatchCode getNextRowOrNextColumn(Cell cell)
ColumnTracker
getNextRowOrNextColumn
in interface ColumnTracker
public void beforeShipped()
ShipperListener
Shipper.shipped()
is performed nbeforeShipped
in interface ShipperListener
public boolean isDone(long timestamp)
ColumnTracker
true
to early out based on timestamp.isDone
in interface ColumnTracker
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.