hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject hbase git commit: HBASE-14826 Small improvement in KVHeap seek() API (Ram)
Date Tue, 24 Nov 2015 04:48:09 GMT
Repository: hbase
Updated Branches:
  refs/heads/master daba86773 -> afc5439be


HBASE-14826 Small improvement in KVHeap seek() API (Ram)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/afc5439b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/afc5439b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/afc5439b

Branch: refs/heads/master
Commit: afc5439be59c1ee74df8a6965cc2c4aad408ee3f
Parents: daba867
Author: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Authored: Tue Nov 24 10:16:35 2015 +0530
Committer: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Committed: Tue Nov 24 10:17:28 2015 +0530

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/KeyValueHeap.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/afc5439b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
index 806eeb5..89fc8fb 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
@@ -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


Mime
View raw message