You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ss...@apache.org on 2016/06/21 01:15:36 UTC
[3/4] phoenix git commit: PHOENIX-3001 Dropping local index and
recreation it with following split may cause RS failure
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/cad2c8d6
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cad2c8d6
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cad2c8d6
Branch: refs/heads/4.x-HBase-1.0
Commit: cad2c8d69b83b2db6c4dac494301b4eecf750eb1
Parents: a7f9906
Author: Sergey Soldatov <ss...@apache.org>
Authored: Thu Jun 16 17:36:19 2016 -0700
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Mon Jun 20 18:14:51 2016 -0700
----------------------------------------------------------------------
.../LocalIndexStoreFileScanner.java | 28 +++++++++-----------
1 file changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/cad2c8d6/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 a6e5005..64ad868 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(Cell 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;