HBASE-13923 Addendum fixes NPE in HRegionServer#buildServerLoad()

This commit is contained in:
tedyu 2015-06-25 16:31:44 -07:00
parent b5b5853043
commit db5dd1ebef
1 changed files with 6 additions and 4 deletions

View File

@ -1182,10 +1182,12 @@ public class HRegionServer extends HasThread implements
RegionLoad.Builder regionLoadBldr = RegionLoad.newBuilder(); RegionLoad.Builder regionLoadBldr = RegionLoad.newBuilder();
RegionSpecifier.Builder regionSpecifier = RegionSpecifier.newBuilder(); RegionSpecifier.Builder regionSpecifier = RegionSpecifier.newBuilder();
for (Region region : regions) { for (Region region : regions) {
Set<String> regionCoprocessors = region.getCoprocessorHost().getCoprocessors(); if (region.getCoprocessorHost() != null) {
Iterator<String> iterator = regionCoprocessors.iterator(); Set<String> regionCoprocessors = region.getCoprocessorHost().getCoprocessors();
while (iterator.hasNext()) { Iterator<String> iterator = regionCoprocessors.iterator();
serverLoad.addCoprocessors(coprocessorBuilder.setName(iterator.next()).build()); while (iterator.hasNext()) {
serverLoad.addCoprocessors(coprocessorBuilder.setName(iterator.next()).build());
}
} }
serverLoad.addRegionLoads(createRegionLoad(region, regionLoadBldr, regionSpecifier)); serverLoad.addRegionLoads(createRegionLoad(region, regionLoadBldr, regionSpecifier));
for (String coprocessor : getWAL(region.getRegionInfo()).getCoprocessorHost() for (String coprocessor : getWAL(region.getRegionInfo()).getCoprocessorHost()