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();
RegionSpecifier.Builder regionSpecifier = RegionSpecifier.newBuilder();
for (Region region : regions) {
Set<String> regionCoprocessors = region.getCoprocessorHost().getCoprocessors();
Iterator<String> iterator = regionCoprocessors.iterator();
while (iterator.hasNext()) {
serverLoad.addCoprocessors(coprocessorBuilder.setName(iterator.next()).build());
if (region.getCoprocessorHost() != null) {
Set<String> regionCoprocessors = region.getCoprocessorHost().getCoprocessors();
Iterator<String> 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()