hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1580149 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
Date Sat, 22 Mar 2014 04:09:17 GMT
Author: larsh
Date: Sat Mar 22 04:09:16 2014
New Revision: 1580149

URL: http://svn.apache.org/r1580149
Log:
HBASE-10805 Speed up KeyValueHeap.next() a bit

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java?rev=1580149&r1=1580148&r2=1580149&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
Sat Mar 22 04:09:16 2014
@@ -112,8 +112,8 @@ public class KeyValueHeap extends NonRev
       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();
       }



Mime
View raw message