private HRegionLocation getCacheLocation(HRegionLocation loc) {
    RegionLocations locs = metaRegionLocations.get();
    return locs != null ? locs.getRegionLocation(loc.getRegion().getReplicaId()) : null;
  }
Get the region locations for meta region. If the location for the given replica is not
available in the cached locations, then fetch from the HBase cluster.
<p/>
The <code>replicaId</code> parameter is important. If the region replication config for meta
region is changed, then the cached region locations may not have the locations for new
replicas. If we do not check the location for the given replica, we will always return the
cached region locations and cause an infinite loop.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncMetaRegionLocator.java