int getNumberOfCachedRegionLocations(TableName tableName) {
    TableCache tableCache = cache.get(tableName);
    if (tableCache == null) {
      return 0;
    }
    return tableCache.regionLocationCache.getAll().stream()
      .mapToInt(RegionLocations::numNonNullElements).sum();
  }
The asynchronous locator for regions other than meta.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java