HBASE-10517 NPE in MetaCache.clearCache()
git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-10070@1567827 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
481a116e26
commit
998cd1642f
|
@ -329,6 +329,9 @@ public class MetaCache {
|
||||||
TableName tableName = location.getRegionInfo().getTable();
|
TableName tableName = location.getRegionInfo().getTable();
|
||||||
ConcurrentMap<byte[], RegionLocations> tableLocations = getTableLocations(tableName);
|
ConcurrentMap<byte[], RegionLocations> tableLocations = getTableLocations(tableName);
|
||||||
RegionLocations rll = tableLocations.get(location.getRegionInfo().getStartKey());
|
RegionLocations rll = tableLocations.get(location.getRegionInfo().getStartKey());
|
||||||
|
if (rll == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
RegionLocations updatedLocations = rll.remove(location);
|
RegionLocations updatedLocations = rll.remove(location);
|
||||||
if (updatedLocations.isEmpty()) {
|
if (updatedLocations.isEmpty()) {
|
||||||
tableLocations.remove(location.getRegionInfo().getStartKey(), rll);
|
tableLocations.remove(location.getRegionInfo().getStartKey(), rll);
|
||||||
|
|
Loading…
Reference in New Issue