Repository: phoenix
Updated Branches:
  refs/heads/master 87664bd3d -> 0f4f8eff7


Fix NPE on startup


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

Branch: refs/heads/master
Commit: 0f4f8eff727fb29d71285882f627d4aa92c2fe2c
Parents: 87664bd
Author: James Taylor <jtay...@salesforce.com>
Authored: Wed Oct 8 21:34:23 2014 -0700
Committer: James Taylor <jtay...@salesforce.com>
Committed: Wed Oct 8 21:35:26 2014 -0700

----------------------------------------------------------------------
 .../org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java     | 2 +-
 .../src/main/java/org/apache/phoenix/schema/PTableImpl.java      | 3 ++-
 .../java/org/apache/phoenix/schema/stats/PTableStatsImpl.java    | 4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f4f8eff/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index 9fbc8d1..62cf8bf 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -601,7 +601,7 @@ public class MetaDataEndpointImpl extends MetaDataProtocol 
implements Coprocesso
         }
         PName physicalTableName = physicalTables.isEmpty() ? 
PNameFactory.newName(SchemaUtil.getTableName(
                 schemaName.getString(), tableName.getString())) : 
physicalTables.get(0);
-        PTableStats stats = null;
+        PTableStats stats = PTableStats.EMPTY_STATS;
         if (tenantId == null) {
             HTableInterface statsHTable = null;
             try {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f4f8eff/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
index e8ca0c1..d883259 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
@@ -65,6 +65,7 @@ import com.google.common.collect.ListMultimap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.protobuf.HBaseZeroCopyByteString;
+import com.sun.istack.NotNull;
 
 /**
  * 
@@ -225,7 +226,7 @@ public class PTableImpl implements PTable {
             PIndexState state, long timeStamp, long sequenceNumber, PName 
pkName, Integer bucketNum,
             List<PColumn> columns, PName dataTableName, List<PTable> indexes, 
boolean isImmutableRows,
             List<PName> physicalNames, PName defaultFamilyName, String 
viewExpression, boolean disableWAL,
-            boolean multiTenant, ViewType viewType, Short viewIndexId, 
IndexType indexType, PTableStats stats)
+            boolean multiTenant, ViewType viewType, Short viewIndexId, 
IndexType indexType, @NotNull PTableStats stats)
             throws SQLException {
         return new PTableImpl(tenantId, schemaName, tableName, type, state, 
timeStamp, sequenceNumber, pkName,
                 bucketNum, columns, dataTableName, indexes, isImmutableRows, 
physicalNames, defaultFamilyName,

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f4f8eff/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/PTableStatsImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/PTableStatsImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/PTableStatsImpl.java
index b527ce1..e7114fe 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/PTableStatsImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/PTableStatsImpl.java
@@ -22,6 +22,8 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 
 import org.apache.hadoop.hbase.util.Bytes;
+
+import com.sun.istack.NotNull;
  
  /**
  * Implementation for PTableStats.
@@ -33,7 +35,7 @@ public class PTableStatsImpl implements PTableStats {
         this(new TreeMap<byte[], List<byte[]>>(Bytes.BYTES_COMPARATOR));
     }
 
-    public PTableStatsImpl(SortedMap<byte[], List<byte[]>> guidePosts) {
+    public PTableStatsImpl(@NotNull SortedMap<byte[], List<byte[]>> 
guidePosts) {
         this.guidePosts = guidePosts;
     }
 

Reply via email to