You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2015/08/29 00:25:04 UTC

[1/5] hbase git commit: HBASE-14315 Save one call to KeyValueHeap.peek per row.

Repository: hbase
Updated Branches:
  refs/heads/branch-1 ab47cb956 -> c277166fd
  refs/heads/branch-1.0 60402b52b -> 89b106231
  refs/heads/branch-1.1 b331902f8 -> 74c5ee41e
  refs/heads/branch-1.2 ab27fe020 -> a733d741f
  refs/heads/master cc1542828 -> cf4c0fb71


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/cf4c0fb7
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cf4c0fb7
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cf4c0fb7

Branch: refs/heads/master
Commit: cf4c0fb71ccb8b15549b2410083434398aa0ebb3
Parents: cc15428
Author: Lars Hofhansl <la...@apache.org>
Authored: Fri Aug 28 15:05:41 2015 -0700
Committer: Lars Hofhansl <la...@apache.org>
Committed: Fri Aug 28 15:05:41 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/StoreScanner.java       | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cf4c0fb7/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 b81ca4c..2cb0b61 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
@@ -518,8 +518,8 @@ 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(false);// Do all cleanup except heap.close()
       return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues();
     }
@@ -531,15 +531,13 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
     // rows. Else it is possible we are still traversing the same row so we must perform the row
     // comparison.
     if (!scannerContext.hasAnyLimit(LimitScope.BETWEEN_CELLS) || matcher.curCell == null ||
-        !CellUtil.matchingRow(peeked, matcher.curCell)) {
+        !CellUtil.matchingRow(cell, matcher.curCell)) {
       this.countPerRow = 0;
-      matcher.setToNewRow(peeked);
+      matcher.setToNewRow(cell);
     }
 
     // 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.
     CellComparator comparator =
@@ -548,7 +546,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();
@@ -659,7 +657,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();


[3/5] hbase git commit: HBASE-14315 Save one call to KeyValueHeap.peek per row.

Posted by la...@apache.org.
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/a733d741
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a733d741
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a733d741

Branch: refs/heads/branch-1.2
Commit: a733d741f411d1994d8e4d6ac118f3f65eee406e
Parents: ab27fe0
Author: Lars Hofhansl <la...@apache.org>
Authored: Fri Aug 28 15:05:41 2015 -0700
Committer: Lars Hofhansl <la...@apache.org>
Committed: Fri Aug 28 15:18:29 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/a733d741/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();


[5/5] hbase git commit: HBASE-14315 Save one call to KeyValueHeap.peek per row.

Posted by la...@apache.org.
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/89b10623
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/89b10623
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/89b10623

Branch: refs/heads/branch-1.0
Commit: 89b106231f6f10a13a2fbc317c5770a3841db7ab
Parents: 60402b5
Author: Lars Hofhansl <la...@apache.org>
Authored: Fri Aug 28 15:05:41 2015 -0700
Committer: Lars Hofhansl <la...@apache.org>
Committed: Fri Aug 28 15:24:49 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/89b10623/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 4ba7235..24f2f54 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
@@ -463,25 +463,23 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
       return false;
     }
 
-    Cell peeked = this.heap.peek();
-    if (peeked == null) {
+    Cell cell = this.heap.peek();
+    if (cell == null) {
       close();
       return false;
     }
 
     // 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 (limit < 0 || matcher.row == null || !Bytes.equals(row, offset, length, matcher.row,
         matcher.rowOffset, matcher.rowLength)) {
       this.countPerRow = 0;
       matcher.setRow(row, offset, length);
     }
 
-    Cell cell;
-
     // Only do a sanity-check if store and comparator are available.
     KeyValue.KVComparator comparator =
         store != null ? store.getComparator() : null;
@@ -489,7 +487,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
     int count = 0;
     long totalBytesRead = 0;
 
-    LOOP: while((cell = this.heap.peek()) != null) {
+    LOOP: do {
       if (prevCell != cell) ++kvsScanned; // Do object compare - we set prevKV from the same heap.
       checkScanOrder(prevCell, cell, comparator);
       prevCell = cell;
@@ -584,7 +582,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
         default:
           throw new RuntimeException("UNEXPECTED");
       }
-    }
+    } while((cell = this.heap.peek()) != null);
 
     if (count > 0) {
       return true;


[4/5] hbase git commit: HBASE-14315 Save one call to KeyValueHeap.peek per row.

Posted by la...@apache.org.
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/74c5ee41
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/74c5ee41
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/74c5ee41

Branch: refs/heads/branch-1.1
Commit: 74c5ee41ed10971b8d7cc515695d3ca07faff13a
Parents: b331902
Author: Lars Hofhansl <la...@apache.org>
Authored: Fri Aug 28 15:05:41 2015 -0700
Committer: Lars Hofhansl <la...@apache.org>
Committed: Fri Aug 28 15:20:58 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/74c5ee41/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 f7e06ef..917412d 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();


[2/5] hbase git commit: HBASE-14315 Save one call to KeyValueHeap.peek per row.

Posted by la...@apache.org.
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 <la...@apache.org>
Authored: Fri Aug 28 15:05:41 2015 -0700
Committer: Lars Hofhansl <la...@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();