hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1580146 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
Date Sat, 22 Mar 2014 04:06:42 GMT
Author: larsh
Date: Sat Mar 22 04:06:41 2014
New Revision: 1580146

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

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java?rev=1580146&r1=1580145&r2=1580146&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
Sat Mar 22 04:06:41 2014
@@ -99,8 +99,8 @@ public class KeyValueHeap extends NonLaz
       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