HBASE-14826 Small improvement in KVHeap seek() API (Ram)
This commit is contained in:
parent
daba867734
commit
afc5439be5
|
@ -297,11 +297,9 @@ public class KeyValueHeap extends NonReversedNonLazyKeyValueScanner
|
|||
if (current == null) {
|
||||
return false;
|
||||
}
|
||||
heap.add(current);
|
||||
current = null;
|
||||
|
||||
KeyValueScanner scanner;
|
||||
while ((scanner = heap.poll()) != null) {
|
||||
KeyValueScanner scanner = current;
|
||||
while (scanner != null) {
|
||||
Cell topKey = scanner.peek();
|
||||
if (comparator.getComparator().compare(seekKey, topKey) <= 0) {
|
||||
// Top KeyValue is at-or-after Seek KeyValue. We only know that all
|
||||
|
@ -329,6 +327,10 @@ public class KeyValueHeap extends NonReversedNonLazyKeyValueScanner
|
|||
} else {
|
||||
heap.add(scanner);
|
||||
}
|
||||
scanner = heap.poll();
|
||||
if (scanner == null) {
|
||||
current = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Heap is returning empty, scanner is done
|
||||
|
|
Loading…
Reference in New Issue