From f248f8639665d1f859c2e5cd1cc492d00e691ab4 Mon Sep 17 00:00:00 2001 From: tedyu Date: Thu, 25 Jun 2015 16:30:52 -0700 Subject: [PATCH] HBASE-13923 Addendum fixes NPE in HRegionServer#buildServerLoad() --- .../hadoop/hbase/regionserver/HRegionServer.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 38e62a7ec85..ad1bacb3f6a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -1177,10 +1177,12 @@ public class HRegionServer extends HasThread implements RegionLoad.Builder regionLoadBldr = RegionLoad.newBuilder(); RegionSpecifier.Builder regionSpecifier = RegionSpecifier.newBuilder(); for (Region region : regions) { - Set regionCoprocessors = region.getCoprocessorHost().getCoprocessors(); - Iterator iterator = regionCoprocessors.iterator(); - while (iterator.hasNext()) { - serverLoad.addCoprocessors(coprocessorBuilder.setName(iterator.next()).build()); + if (region.getCoprocessorHost() != null) { + Set regionCoprocessors = region.getCoprocessorHost().getCoprocessors(); + Iterator iterator = regionCoprocessors.iterator(); + while (iterator.hasNext()) { + serverLoad.addCoprocessors(coprocessorBuilder.setName(iterator.next()).build()); + } } serverLoad.addRegionLoads(createRegionLoad(region, regionLoadBldr, regionSpecifier)); for (String coprocessor : getWAL(region.getRegionInfo()).getCoprocessorHost()