HBASE-21590 Optimize trySkipToNextColumn in StoreScanner a bit.
(cherry picked from commit 11193d7cc1
)
This commit is contained in:
parent
12dfc8bafd
commit
5c7c425e34
|
@ -808,12 +808,16 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
|
|||
@VisibleForTesting
|
||||
protected boolean trySkipToNextRow(Cell cell) throws IOException {
|
||||
Cell nextCell = null;
|
||||
// used to guard against a changed next indexed key by doing a identity comparison
|
||||
// when the identity changes we need to compare the bytes again
|
||||
Cell previousIndexedKey = null;
|
||||
do {
|
||||
Cell nextIndexedKey = getNextIndexedKey();
|
||||
if (nextIndexedKey != null && nextIndexedKey != KeyValueScanner.NO_NEXT_INDEXED_KEY
|
||||
&& matcher.compareKeyForNextRow(nextIndexedKey, cell) >= 0) {
|
||||
&& (nextIndexedKey == previousIndexedKey || matcher.compareKeyForNextRow(nextIndexedKey, cell) >= 0)) {
|
||||
this.heap.next();
|
||||
++kvsScanned;
|
||||
previousIndexedKey = nextIndexedKey;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -829,12 +833,16 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
|
|||
@VisibleForTesting
|
||||
protected boolean trySkipToNextColumn(Cell cell) throws IOException {
|
||||
Cell nextCell = null;
|
||||
// used to guard against a changed next indexed key by doing a identity comparison
|
||||
// when the identity changes we need to compare the bytes again
|
||||
Cell previousIndexedKey = null;
|
||||
do {
|
||||
Cell nextIndexedKey = getNextIndexedKey();
|
||||
if (nextIndexedKey != null && nextIndexedKey != KeyValueScanner.NO_NEXT_INDEXED_KEY
|
||||
&& matcher.compareKeyForNextColumn(nextIndexedKey, cell) >= 0) {
|
||||
&& (nextIndexedKey == previousIndexedKey || matcher.compareKeyForNextColumn(nextIndexedKey, cell) >= 0)) {
|
||||
this.heap.next();
|
||||
++kvsScanned;
|
||||
previousIndexedKey = nextIndexedKey;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue