hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [2/5] hbase git commit: HBASE-14315 Save one call to KeyValueHeap.peek per row.
Date Fri, 28 Aug 2015 22:25:05 GMT
HBASE-14315 Save one call to KeyValueHeap.peek per row.


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

Branch: refs/heads/branch-1
Commit: c277166fd1f3104c0db9011f700eebf404b812ad
Parents: ab47cb9
Author: Lars Hofhansl <larsh@apache.org>
Authored: Fri Aug 28 15:05:41 2015 -0700
Committer: Lars Hofhansl <larsh@apache.org>
Committed: Fri Aug 28 15:17:50 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/StoreScanner.java     | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c277166f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
index c7991c0..916e997 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
@@ -496,17 +496,17 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
       return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues();
     }
 
-    Cell peeked = this.heap.peek();
-    if (peeked == null) {
+    Cell cell = this.heap.peek();
+    if (cell == null) {
       close();
       return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues();
     }
 
     // only call setRow if the row changes; avoids confusing the query matcher
     // if scanning intra-row
-    byte[] row = peeked.getRowArray();
-    int offset = peeked.getRowOffset();
-    short length = peeked.getRowLength();
+    byte[] row = cell.getRowArray();
+    int offset = cell.getRowOffset();
+    short length = cell.getRowLength();
 
     // If no limits exists in the scope LimitScope.Between_Cells then we are sure we are
changing
     // rows. Else it is possible we are still traversing the same row so we must perform
the row
@@ -520,8 +520,6 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
     // Clear progress away unless invoker has indicated it should be kept.
     if (!scannerContext.getKeepProgress()) scannerContext.clearProgress();
     
-    Cell cell;
-
     // Only do a sanity-check if store and comparator are available.
     KeyValue.KVComparator comparator =
         store != null ? store.getComparator() : null;
@@ -529,7 +527,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
     int count = 0;
     long totalBytesRead = 0;
 
-    LOOP: while((cell = this.heap.peek()) != null) {
+    LOOP: do {
       // Update and check the time limit based on the configured value of cellsPerTimeoutCheck
       if ((kvsScanned % cellsPerHeartbeatCheck == 0)) {
         scannerContext.updateTimeProgress();
@@ -642,7 +640,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
         default:
           throw new RuntimeException("UNEXPECTED");
       }
-    }
+    } while((cell = this.heap.peek()) != null);
 
     if (count > 0) {
       return scannerContext.setScannerState(NextState.MORE_VALUES).hasMoreValues();


Mime
View raw message