Details
Description
HCM uses SoftValueSortedMap to cache region locations. Under load, some soft referred values may be GCed. So we should check if the value is null. Otherwise, NPE will be thrown:
for (Map<byte[], HRegionLocation> tableLocations : cachedRegionLocations.values()) { for (Entry<byte[], HRegionLocation> e : tableLocations.entrySet()) { ===> if (serverName.equals(e.getValue().getServerName())) { tableLocations.remove(e.getKey()); deletedSomething = true; } } }