public HRegionLocation getRegionLocationByRegionName(byte[] regionName) {
    for (HRegionLocation loc : locations) {
      if (loc != null) {
        if (
          Bytes.equals(loc.getRegion().getRegionName(), regionName)
            || Bytes.equals(loc.getRegion().getEncodedNameAsBytes(), regionName)
        ) {
          return loc;
        }
      }
    }
    return null;
  }
Returns the region location from the list for matching regionName, which can be regionName or
encodedRegionName
@param regionName regionName or encodedRegionName
@return HRegionLocation found or null
hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLocations.java