hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1580147 - /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
Date Sat, 22 Mar 2014 04:08:00 GMT
Author: larsh
Date: Sat Mar 22 04:08:00 2014
New Revision: 1580147

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

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

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java?rev=1580147&r1=1580146&r2=1580147&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
Sat Mar 22 04:08:00 2014
@@ -101,8 +101,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