Repository: hbase
Updated Branches:
  refs/heads/master bb6cc4d43 -> 6c89c6251


HBASE-16866 Avoid NPE in AsyncRequestFutureImpl#updateStats (ChiaPing Tsai)


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

Branch: refs/heads/master
Commit: 6c89c6251ff611c2f10bfd6f8c9f8a2d717dc71b
Parents: bb6cc4d
Author: tedyu <yuzhih...@gmail.com>
Authored: Tue Oct 18 11:10:33 2016 -0700
Committer: tedyu <yuzhih...@gmail.com>
Committed: Tue Oct 18 11:10:33 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/6c89c625/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
index d48179b..6b6b99a 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java
@@ -977,6 +977,11 @@ class AsyncRequestFutureImpl<CResult> implements 
AsyncRequestFuture {
     for (Map.Entry<byte[], MultiResponse.RegionResult> regionStats : 
results.entrySet()) {
       byte[] regionName = regionStats.getKey();
       ClientProtos.RegionLoadStats stat = regionStats.getValue().getStat();
+      if (stat == null) {
+        LOG.error("No ClientProtos.RegionLoadStats found for server=" + server
+          + ", region=" + Bytes.toStringBinary(regionName));
+        continue;
+      }
       RegionLoadStats regionLoadstats = 
ProtobufUtil.createRegionLoadStats(stat);
       
ResultStatsUtil.updateStats(asyncProcess.connection.getStatisticsTracker(), 
server,
           regionName, regionLoadstats);

Reply via email to