PHOENIX-3765 NPE in IndexMaintainer when using old client and 4.10 server

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

Branch: refs/heads/omid
Commit: cd444d9a6a8e560889826bc491db7d71ad1960e5
Parents: 92e728e
Author: Samarth <[email protected]>
Authored: Thu Apr 6 12:34:36 2017 -0700
Committer: Samarth <[email protected]>
Committed: Thu Apr 6 12:34:36 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/index/IndexMaintainer.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cd444d9a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
index 2224e38..26c2421 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
@@ -1308,6 +1308,9 @@ public class IndexMaintainer implements Writable, 
Iterable<ColumnReference> {
         int encodedEstimatedIndexRowKeyBytesAndImmutableRows = 
WritableUtils.readVInt(input);
         this.immutableRows = encodedEstimatedIndexRowKeyBytesAndImmutableRows 
< 0;
         this.estimatedIndexRowKeyBytes = 
Math.abs(encodedEstimatedIndexRowKeyBytesAndImmutableRows);
+        // Needed for backward compatibility. Clients older than 4.10 will 
have non-encoded tables.
+        this.immutableStorageScheme = 
ImmutableStorageScheme.ONE_CELL_PER_COLUMN;
+        this.encodingScheme = QualifierEncodingScheme.NON_ENCODED_QUALIFIERS;
         initCachedState();
     }
     

Reply via email to