HBASE-1643 ScanDeleteTracker takes comparator but it unused
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@793084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
60e69c6982
commit
f10f85f0ff
|
@ -462,6 +462,7 @@ Release 0.20.0 - Unreleased
|
|||
Scan (Jon Gray via Nitay)
|
||||
HBASE-1640 Allow passing arguments to jruby script run when run by bin/hbase shell
|
||||
HBASE-698 HLog recovery is not performed after master failure
|
||||
HBASE-1643 ScanDeleteTracker takes comparator but it unused
|
||||
|
||||
OPTIMIZATIONS
|
||||
HBASE-1412 Change values for delete column and column family in KeyValue
|
||||
|
|
|
@ -41,7 +41,7 @@ public class MinorCompactingStoreScanner implements KeyValueScanner, InternalSca
|
|||
MinorCompactingStoreScanner(Store store,
|
||||
KeyValueScanner [] scanners) {
|
||||
comparator = store.comparator;
|
||||
deleteTracker = new ScanDeleteTracker(store.comparator.getRawComparator());
|
||||
deleteTracker = new ScanDeleteTracker();
|
||||
KeyValue firstKv = KeyValue.createFirstOnRow(HConstants.EMPTY_START_ROW);
|
||||
for (KeyValueScanner scanner : scanners ) {
|
||||
scanner.seek(firstKv);
|
||||
|
@ -53,7 +53,7 @@ public class MinorCompactingStoreScanner implements KeyValueScanner, InternalSca
|
|||
MinorCompactingStoreScanner(String cfName, KeyValue.KVComparator comparator,
|
||||
KeyValueScanner [] scanners) {
|
||||
this.comparator = comparator;
|
||||
deleteTracker = new ScanDeleteTracker(comparator.getRawComparator());
|
||||
deleteTracker = new ScanDeleteTracker();
|
||||
|
||||
KeyValue firstKv = KeyValue.createFirstOnRow(HConstants.EMPTY_START_ROW);
|
||||
for (KeyValueScanner scanner : scanners ) {
|
||||
|
|
|
@ -47,14 +47,11 @@ public class ScanDeleteTracker implements DeleteTracker {
|
|||
private byte deleteType = 0;
|
||||
private long deleteTimestamp = 0L;
|
||||
|
||||
private KeyValue.KeyComparator comparator;
|
||||
|
||||
/**
|
||||
* Constructor for ScanDeleteTracker
|
||||
* @param comparator
|
||||
*/
|
||||
public ScanDeleteTracker(KeyValue.KeyComparator comparator) {
|
||||
this.comparator = comparator;
|
||||
public ScanDeleteTracker() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +109,6 @@ public class ScanDeleteTracker implements DeleteTracker {
|
|||
}
|
||||
|
||||
if (deleteBuffer != null) {
|
||||
// TODO ryan use a specific comparator
|
||||
int ret = Bytes.compareTo(deleteBuffer, deleteOffset, deleteLength,
|
||||
buffer, qualifierOffset, qualifierLength);
|
||||
|
||||
|
@ -158,5 +154,4 @@ public class ScanDeleteTracker implements DeleteTracker {
|
|||
public void update() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
}
|
|
@ -24,7 +24,6 @@ import java.util.NavigableSet;
|
|||
|
||||
import org.apache.hadoop.hbase.KeyValue;
|
||||
import org.apache.hadoop.hbase.client.Scan;
|
||||
import org.apache.hadoop.hbase.filter.Filter;
|
||||
import org.apache.hadoop.hbase.filter.RowFilterInterface;
|
||||
import org.apache.hadoop.hbase.filter.Filter.ReturnCode;
|
||||
import org.apache.hadoop.hbase.util.Bytes;
|
||||
|
@ -54,8 +53,7 @@ public class ScanQueryMatcher extends QueryMatcher {
|
|||
this.tr = scan.getTimeRange();
|
||||
this.oldestStamp = System.currentTimeMillis() - ttl;
|
||||
this.rowComparator = rowComparator;
|
||||
// shouldn't this be ScanDeleteTracker?
|
||||
this.deletes = new ScanDeleteTracker(rowComparator);
|
||||
this.deletes = new ScanDeleteTracker();
|
||||
this.startKey = KeyValue.createFirstOnRow(scan.getStartRow());
|
||||
this.stopKey = KeyValue.createFirstOnRow(scan.getStopRow());
|
||||
this.filter = scan.getFilter();
|
||||
|
@ -166,7 +164,8 @@ public class ScanQueryMatcher extends QueryMatcher {
|
|||
return MatchCode.SKIP;
|
||||
}
|
||||
|
||||
if (deletes.isDeleted(bytes, offset, qualLength, timestamp)) {
|
||||
if (!this.deletes.isEmpty() &&
|
||||
deletes.isDeleted(bytes, offset, qualLength, timestamp)) {
|
||||
return MatchCode.SKIP;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue