HBASE-4469 Avoid top row seek by looking up bloomfilter (liyin via jgray)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1183155 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4b902528e7
commit
69761be2c2
|
@ -15,6 +15,7 @@ Release 0.93.0 - Unreleased
|
|||
HBASE-4422 Move block cache parameters and references into single
|
||||
CacheConf class (jgray)
|
||||
HBASE-4102 atomicAppend: A put that appends to the latest version of a cell (Lars H)
|
||||
HBASE-4469 Avoid top row seek by looking up bloomfilter (liyin via jgray)
|
||||
|
||||
BUG FIXES
|
||||
HBASE-4488 Store could miss rows during flush (Lars H via jgray)
|
||||
|
|
|
@ -76,7 +76,7 @@ public class ScanQueryMatcher {
|
|||
this.rowComparator = rowComparator;
|
||||
this.deletes = new ScanDeleteTracker();
|
||||
this.stopRow = scan.getStopRow();
|
||||
this.startKey = KeyValue.createFirstOnRow(scan.getStartRow());
|
||||
this.startKey = KeyValue.createFirstOnRow(scan.getStartRow(), family, null);
|
||||
this.filter = scan.getFilter();
|
||||
this.retainDeletesInOutput = retainDeletesInOutput;
|
||||
|
||||
|
|
|
@ -50,6 +50,11 @@ class StoreFileScanner implements KeyValueScanner {
|
|||
private boolean delayedReseek;
|
||||
private KeyValue delayedSeekKV;
|
||||
|
||||
//The variable, realSeekDone, may cheat on store file scanner for the
|
||||
// multi-column bloom-filter optimization.
|
||||
// So this flag shows whether this storeFileScanner could do a reseek.
|
||||
private boolean isReseekable = false;
|
||||
|
||||
private static final AtomicLong seekCount = new AtomicLong();
|
||||
|
||||
/**
|
||||
|
@ -108,6 +113,8 @@ class StoreFileScanner implements KeyValueScanner {
|
|||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.isReseekable = true;
|
||||
cur = hfs.getKeyValue();
|
||||
return true;
|
||||
} finally {
|
||||
|
@ -269,7 +276,7 @@ class StoreFileScanner implements KeyValueScanner {
|
|||
if (realSeekDone)
|
||||
return;
|
||||
|
||||
if (delayedReseek) {
|
||||
if (delayedReseek && this.isReseekable) {
|
||||
reseek(delayedSeekKV);
|
||||
} else {
|
||||
seek(delayedSeekKV);
|
||||
|
|
|
@ -98,9 +98,11 @@ class StoreScanner extends NonLazyKeyValueScanner
|
|||
|
||||
// Seek all scanners to the start of the Row (or if the exact matching row
|
||||
// key does not exist, then to the start of the next matching Row).
|
||||
// Always check bloom filter to optimize the top row seek for delete
|
||||
// family marker.
|
||||
if (explicitColumnQuery && lazySeekEnabledGlobally) {
|
||||
for (KeyValueScanner scanner : scanners) {
|
||||
scanner.requestSeek(matcher.getStartKey(), false, useRowColBloom);
|
||||
scanner.requestSeek(matcher.getStartKey(), false, true);
|
||||
}
|
||||
} else {
|
||||
for (KeyValueScanner scanner : scanners) {
|
||||
|
|
Loading…
Reference in New Issue