private RegionInfo getRegionInfo(HBaseProtos.RegionSpecifier rs) throws ServiceException {
    // TODO: this doesn't handle MOB regions. Should it? See the public method #getRegionInfo
    final AssignmentManager am = server.getAssignmentManager();
    final String encodedRegionName;
    final RegionInfo info;
    // first try resolving from the AM's caches.
    switch (rs.getType()) {
      case REGION_NAME:
        final byte[] regionName = rs.getValue().toByteArray();
        encodedRegionName = RegionInfo.encodeRegionName(regionName);
        info = am.getRegionInfo(regionName);
        break;
      case ENCODED_REGION_NAME:
        encodedRegionName = rs.getValue().toStringUtf8();
        info = am.getRegionInfo(encodedRegionName);
        break;
      default:
        throw new IllegalArgumentException("Unrecognized RegionSpecifierType " + rs.getType());
    }
    if (info != null) {
      return info;
    }
    // fall back to a meta scan and check the cache again.
    try {
      am.populateRegionStatesFromMeta(encodedRegionName);
    } catch (IOException e) {
      throw new ServiceException(e);
    }
    return am.getRegionInfo(encodedRegionName);
  }
Get {@link RegionInfo} from Master using content of {@link RegionSpecifier} as key.
@return {@link RegionInfo} found by decoding {@code rs} or {@code null} if {@code rs} is
        unknown to the master.
@throws ServiceException If some error occurs while querying META or parsing results.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java