public synchronized void removeForServer(ServerName serverName) {
    for (Map.Entry<byte[], RegionLocations> entry : cache.entrySet()) {
      byte[] regionName = entry.getKey();
      RegionLocations locs = entry.getValue();
      RegionLocations newLocs = locs.removeByServer(serverName);
      if (locs == newLocs) {
        continue;
      }
      if (newLocs.isEmpty()) {
        cache.remove(regionName, locs);
      } else {
        cache.put(regionName, newLocs);
      }
    }
  }
Removes serverName from all locations in the cache, fully removing any RegionLocations which
are empty after removing the server from it.
@param serverName server to remove from locations
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocationCache.java