HBASE-10805 Speed up KeyValueHeap.next() a bit

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1580149 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2014-03-22 04:09:16 +00:00
parent c4610ecab2
commit 2d17ce3999
1 changed files with 2 additions and 2 deletions

View File

@ -112,8 +112,8 @@ public class KeyValueHeap extends NonReversedNonLazyKeyValueScanner
this.current = pollRealKV();
} else {
KeyValueScanner topScanner = this.heap.peek();
if (topScanner == null ||
this.comparator.compare(kvNext, topScanner.peek()) >= 0) {
// no need to add current back to the heap if it is the only scanner left
if (topScanner != null && this.comparator.compare(kvNext, topScanner.peek()) >= 0) {
this.heap.add(this.current);
this.current = pollRealKV();
}