Revert "HBASE-16840 Reuse cell's timestamp and type in ScanQueryMatcher" to update author
This reverts commit 28de528c6e
.
This commit is contained in:
parent
28de528c6e
commit
e33fd427e4
|
@ -171,7 +171,7 @@ public class LegacyScanQueryMatcher extends ScanQueryMatcher {
|
||||||
long timestamp = cell.getTimestamp();
|
long timestamp = cell.getTimestamp();
|
||||||
byte typeByte = cell.getTypeByte();
|
byte typeByte = cell.getTypeByte();
|
||||||
long mvccVersion = cell.getSequenceId();
|
long mvccVersion = cell.getSequenceId();
|
||||||
if (CellUtil.isDelete(typeByte)) {
|
if (CellUtil.isDelete(cell)) {
|
||||||
if (keepDeletedCells == KeepDeletedCells.FALSE
|
if (keepDeletedCells == KeepDeletedCells.FALSE
|
||||||
|| (keepDeletedCells == KeepDeletedCells.TTL && timestamp < oldestUnexpiredTS)) {
|
|| (keepDeletedCells == KeepDeletedCells.TTL && timestamp < oldestUnexpiredTS)) {
|
||||||
// first ignore delete markers if the scanner can do so, and the
|
// first ignore delete markers if the scanner can do so, and the
|
||||||
|
|
|
@ -43,7 +43,6 @@ public class MajorCompactionScanQueryMatcher extends DropDeletesCompactionScanQu
|
||||||
}
|
}
|
||||||
long timestamp = cell.getTimestamp();
|
long timestamp = cell.getTimestamp();
|
||||||
long mvccVersion = cell.getSequenceId();
|
long mvccVersion = cell.getSequenceId();
|
||||||
byte typeByte = cell.getTypeByte();
|
|
||||||
|
|
||||||
// The delete logic is pretty complicated now.
|
// The delete logic is pretty complicated now.
|
||||||
// This is corroborated by the following:
|
// This is corroborated by the following:
|
||||||
|
@ -57,7 +56,7 @@ public class MajorCompactionScanQueryMatcher extends DropDeletesCompactionScanQu
|
||||||
// 7. Delete marker need to be version counted together with puts
|
// 7. Delete marker need to be version counted together with puts
|
||||||
// they affect
|
// they affect
|
||||||
//
|
//
|
||||||
if (CellUtil.isDelete(typeByte)) {
|
if (CellUtil.isDelete(cell)) {
|
||||||
if (mvccVersion > maxReadPointToTrackVersions) {
|
if (mvccVersion > maxReadPointToTrackVersions) {
|
||||||
// We can not drop this delete marker yet, and also we should not use this delete marker to
|
// We can not drop this delete marker yet, and also we should not use this delete marker to
|
||||||
// mask any cell yet.
|
// mask any cell yet.
|
||||||
|
@ -75,7 +74,7 @@ public class MajorCompactionScanQueryMatcher extends DropDeletesCompactionScanQu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Skip checking column since we do not remove column during compaction.
|
// Skip checking column since we do not remove column during compaction.
|
||||||
return columns.checkVersions(cell, timestamp, typeByte,
|
return columns.checkVersions(cell, timestamp, cell.getTypeByte(),
|
||||||
mvccVersion > maxReadPointToTrackVersions);
|
mvccVersion > maxReadPointToTrackVersions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,7 @@ public class MinorCompactionScanQueryMatcher extends CompactionScanQueryMatcher
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
long mvccVersion = cell.getSequenceId();
|
long mvccVersion = cell.getSequenceId();
|
||||||
byte typeByte = cell.getTypeByte();
|
if (CellUtil.isDelete(cell)) {
|
||||||
if (CellUtil.isDelete(typeByte)) {
|
|
||||||
if (mvccVersion > maxReadPointToTrackVersions) {
|
if (mvccVersion > maxReadPointToTrackVersions) {
|
||||||
// we should not use this delete marker to mask any cell yet.
|
// we should not use this delete marker to mask any cell yet.
|
||||||
return MatchCode.INCLUDE;
|
return MatchCode.INCLUDE;
|
||||||
|
@ -56,7 +55,7 @@ public class MinorCompactionScanQueryMatcher extends CompactionScanQueryMatcher
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
// Skip checking column since we do not remove column during compaction.
|
// Skip checking column since we do not remove column during compaction.
|
||||||
return columns.checkVersions(cell, cell.getTimestamp(), typeByte,
|
return columns.checkVersions(cell, cell.getTimestamp(), cell.getTypeByte(),
|
||||||
mvccVersion > maxReadPointToTrackVersions);
|
mvccVersion > maxReadPointToTrackVersions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,7 @@ public class NormalUserScanQueryMatcher extends UserScanQueryMatcher {
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
long timestamp = cell.getTimestamp();
|
long timestamp = cell.getTimestamp();
|
||||||
byte typeByte = cell.getTypeByte();
|
if (CellUtil.isDelete(cell)) {
|
||||||
if (CellUtil.isDelete(typeByte)) {
|
|
||||||
boolean includeDeleteMarker = seePastDeleteMarkers ? tr.withinTimeRange(timestamp)
|
boolean includeDeleteMarker = seePastDeleteMarkers ? tr.withinTimeRange(timestamp)
|
||||||
: tr.withinOrAfterTimeRange(timestamp);
|
: tr.withinOrAfterTimeRange(timestamp);
|
||||||
if (includeDeleteMarker) {
|
if (includeDeleteMarker) {
|
||||||
|
@ -73,7 +72,7 @@ public class NormalUserScanQueryMatcher extends UserScanQueryMatcher {
|
||||||
if (returnCode != null) {
|
if (returnCode != null) {
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
return matchColumn(cell, timestamp, typeByte);
|
return matchColumn(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,11 +44,9 @@ public class RawScanQueryMatcher extends UserScanQueryMatcher {
|
||||||
if (returnCode != null) {
|
if (returnCode != null) {
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
long timestamp = cell.getTimestamp();
|
|
||||||
byte typeByte = cell.getTypeByte();
|
|
||||||
// For a raw scan, we do not filter out any cells by delete marker, and delete marker is also
|
// For a raw scan, we do not filter out any cells by delete marker, and delete marker is also
|
||||||
// returned, so we do not need to track delete.
|
// returned, so we do not need to track delete.
|
||||||
return matchColumn(cell, timestamp, typeByte);
|
return matchColumn(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -55,8 +55,7 @@ public class StripeCompactionScanQueryMatcher extends DropDeletesCompactionScanQ
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
long mvccVersion = cell.getSequenceId();
|
long mvccVersion = cell.getSequenceId();
|
||||||
byte typeByte = cell.getTypeByte();
|
if (CellUtil.isDelete(cell)) {
|
||||||
if (CellUtil.isDelete(typeByte)) {
|
|
||||||
if (mvccVersion > maxReadPointToTrackVersions) {
|
if (mvccVersion > maxReadPointToTrackVersions) {
|
||||||
return MatchCode.INCLUDE;
|
return MatchCode.INCLUDE;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +77,7 @@ public class StripeCompactionScanQueryMatcher extends DropDeletesCompactionScanQ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Skip checking column since we do not remove column during compaction.
|
// Skip checking column since we do not remove column during compaction.
|
||||||
return columns.checkVersions(cell, cell.getTimestamp(), typeByte,
|
return columns.checkVersions(cell, cell.getTimestamp(), cell.getTypeByte(),
|
||||||
mvccVersion > maxReadPointToTrackVersions);
|
mvccVersion > maxReadPointToTrackVersions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,8 +88,8 @@ public abstract class UserScanQueryMatcher extends ScanQueryMatcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final MatchCode matchColumn(Cell cell, long timestamp, byte typeByte)
|
protected final MatchCode matchColumn(Cell cell) throws IOException {
|
||||||
throws IOException {
|
long timestamp = cell.getTimestamp();
|
||||||
int tsCmp = tr.compare(timestamp);
|
int tsCmp = tr.compare(timestamp);
|
||||||
if (tsCmp > 0) {
|
if (tsCmp > 0) {
|
||||||
return MatchCode.SKIP;
|
return MatchCode.SKIP;
|
||||||
|
@ -97,6 +97,7 @@ public abstract class UserScanQueryMatcher extends ScanQueryMatcher {
|
||||||
if (tsCmp < 0) {
|
if (tsCmp < 0) {
|
||||||
return columns.getNextRowOrNextColumn(cell);
|
return columns.getNextRowOrNextColumn(cell);
|
||||||
}
|
}
|
||||||
|
byte typeByte = cell.getTypeByte();
|
||||||
// STEP 1: Check if the column is part of the requested columns
|
// STEP 1: Check if the column is part of the requested columns
|
||||||
MatchCode colChecker = columns.checkColumn(cell, typeByte);
|
MatchCode colChecker = columns.checkColumn(cell, typeByte);
|
||||||
if (colChecker != MatchCode.INCLUDE) {
|
if (colChecker != MatchCode.INCLUDE) {
|
||||||
|
|
Loading…
Reference in New Issue