phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbo...@apache.org
Subject phoenix git commit: PHOENIX-4662 Avoid NPE when server-caches are null (Csaba Skrabak)
Date Fri, 23 Mar 2018 19:03:52 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.11 13c1309c2 -> 03fd0bab5


PHOENIX-4662 Avoid NPE when server-caches are null (Csaba Skrabak)


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

Branch: refs/heads/4.x-cdh5.11
Commit: 03fd0bab54e8752935db939b75bbc317690f8f45
Parents: 13c1309
Author: Josh Elser <elserj@apache.org>
Authored: Thu Mar 22 20:03:21 2018 +0000
Committer: Pedro Boado <pboado@apache.org>
Committed: Fri Mar 23 19:02:31 2018 +0000

----------------------------------------------------------------------
 .../java/org/apache/phoenix/iterate/TableResultIterator.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/03fd0bab/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
index e812854..f6902cc 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java
@@ -198,9 +198,12 @@ public class TableResultIterator implements ResultIterator {
 							retry--;
 							try {
 								Long cacheId = ((HashJoinCacheNotFoundException) e1).getCacheId();
+
+								ServerCache cache = caches == null ? null :
+										caches.get(new ImmutableBytesPtr(Bytes.toBytes(cacheId)));
+
 								if (!hashCacheClient.addHashCacheToServer(newScan.getStartRow(),
-										caches.get(new ImmutableBytesPtr(Bytes.toBytes(cacheId))),
-										plan.getTableRef().getTable())) {
+										cache, plan.getTableRef().getTable())) {
 									throw e1;
 								}
 								this.scanIterator = ((BaseQueryPlan) plan).iterator(caches, scanGrouper, newScan);


Mime
View raw message