hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [4/5] hbase git commit: HBASE-14539 Slight improvement of StoreScanner.optimize.
Date Sat, 03 Oct 2015 03:28:54 GMT
HBASE-14539 Slight improvement of StoreScanner.optimize.


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

Branch: refs/heads/branch-1.1
Commit: 31ef9b3bbae67e50cceacbc8fc9529ebf228d916
Parents: 8ee8cf5
Author: Lars Hofhansl <larsh@apache.org>
Authored: Fri Oct 2 20:23:03 2015 -0700
Committer: Lars Hofhansl <larsh@apache.org>
Committed: Fri Oct 2 20:28:09 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/StoreScanner.java | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/31ef9b3b/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 917412d..9f86d4d 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
@@ -659,16 +659,13 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
    * (see HBASE-13109)
    */
   private ScanQueryMatcher.MatchCode optimize(ScanQueryMatcher.MatchCode qcode, Cell cell)
{
-    Cell nextIndexedKey = getNextIndexedKey();
-    if (nextIndexedKey == null || nextIndexedKey == HConstants.NO_NEXT_INDEXED_KEY ||
-        store == null) {
-      return qcode;
-    }
     switch(qcode) {
     case INCLUDE_AND_SEEK_NEXT_COL:
     case SEEK_NEXT_COL:
     {
-      if (matcher.compareKeyForNextColumn(nextIndexedKey, cell) >= 0) {
+      Cell nextIndexedKey = getNextIndexedKey();
+      if (nextIndexedKey != null && nextIndexedKey != HConstants.NO_NEXT_INDEXED_KEY
+          && matcher.compareKeyForNextColumn(nextIndexedKey, cell) >= 0) {
         return qcode == MatchCode.SEEK_NEXT_COL ? MatchCode.SKIP : MatchCode.INCLUDE;
       }
       break;
@@ -676,7 +673,9 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
     case INCLUDE_AND_SEEK_NEXT_ROW:
     case SEEK_NEXT_ROW:
     {
-      if (matcher.compareKeyForNextRow(nextIndexedKey, cell) >= 0) {
+      Cell nextIndexedKey = getNextIndexedKey();
+      if (nextIndexedKey != null && nextIndexedKey != HConstants.NO_NEXT_INDEXED_KEY
+          && matcher.compareKeyForNextRow(nextIndexedKey, cell) >= 0) {
         return qcode == MatchCode.SEEK_NEXT_ROW ? MatchCode.SKIP : MatchCode.INCLUDE;
       }
       break;


Mime
View raw message