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/10/03 05:28:54 UTC
[4/5] hbase git commit: HBASE-14539 Slight improvement of
StoreScanner.optimize.
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 <la...@apache.org>
Authored: Fri Oct 2 20:23:03 2015 -0700
Committer: Lars Hofhansl <la...@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;