public synchronized boolean remove(HRegionLocation loc) {
    byte[] startKey = loc.getRegion().getStartKey();
    RegionLocations oldLocs = cache.get(startKey);
    if (oldLocs == null) {
      return false;
    }

    HRegionLocation oldLoc = oldLocs.getRegionLocation(loc.getRegion().getReplicaId());
    if (!canUpdateOnError(loc, oldLoc)) {
      return false;
    }

    RegionLocations newLocs = removeRegionLocation(oldLocs, loc.getRegion().getReplicaId());
    if (newLocs == null) {
      if (cache.remove(startKey, oldLocs)) {
        return true;
      }
    } else {
      cache.put(startKey, newLocs);
      return true;
    }
    return false;
  }
Removes the location from the cache if it exists and can be removed.
@return true if entry was removed
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocationCache.java