phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [2/4] phoenix git commit: PHOENIX-3001 Dropping local index and recreation it with following split may cause RS failure
Date Tue, 21 Jun 2016 01:15:35 GMT
PHOENIX-3001 Dropping local index and recreation it with following split may cause RS failure


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 6fb29aac1d642979127e43abd8bccb64df366832
Parents: be3da0b
Author: Sergey Soldatov <ssa@apache.org>
Authored: Thu Jun 16 17:36:19 2016 -0700
Committer: Sergey Soldatov <ssa@apache.org>
Committed: Mon Jun 20 18:12:20 2016 -0700

----------------------------------------------------------------------
 .../LocalIndexStoreFileScanner.java             | 28 +++++++++-----------
 1 file changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6fb29aac/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java
b/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java
index 864f915..cbffa53 100644
--- a/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java
+++ b/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java
@@ -141,13 +141,6 @@ public class LocalIndexStoreFileScanner extends StoreFileScanner{
     }
 
     private boolean isSatisfiedMidKeyCondition(KeyValue kv) {
-        if (CellUtil.isDelete(kv) && kv.getValueLength() == 0) {
-            // In case of a Delete type KV, let it be going to both the daughter regions.
-            // No problems in doing so. In the correct daughter region where it belongs to,
this delete
-            // tomb will really delete a KV. In the other it will just hang around there
with no actual
-            // kv coming for which this is a delete tomb. :)
-            return true;
-        }
         ImmutableBytesWritable rowKey =
                 new ImmutableBytesWritable(kv.getRowArray(), kv.getRowOffset() + reader.getOffset(),
                         kv.getRowLength() - reader.getOffset());
@@ -155,15 +148,18 @@ public class LocalIndexStoreFileScanner extends StoreFileScanner{
         IndexMaintainer indexMaintainer = entry.getValue();
         byte[] viewIndexId = indexMaintainer.getViewIndexIdFromIndexRowKey(rowKey);
         IndexMaintainer actualIndexMaintainer = reader.getIndexMaintainers().get(new ImmutableBytesWritable(viewIndexId));
-        byte[] dataRowKey = actualIndexMaintainer.buildDataRowKey(rowKey, reader.getViewConstants());
-        int compareResult = Bytes.compareTo(dataRowKey, reader.getSplitRow());
-        if (reader.isTop()) {
-            if (compareResult >= 0) {
-                return true;
-            }
-        } else {
-            if (compareResult < 0) {
-                return true;
+        if(actualIndexMaintainer != null) {
+            byte[] dataRowKey = actualIndexMaintainer.buildDataRowKey(rowKey, reader.getViewConstants());
+
+            int compareResult = Bytes.compareTo(dataRowKey, reader.getSplitRow());
+            if (reader.isTop()) {
+                if (compareResult >= 0) {
+                    return true;
+                }
+            } else {
+                if (compareResult < 0) {
+                    return true;
+                }
             }
         }
         return false;


Mime
View raw message