private Set<DistributedRegion> getDistributedRegions(InternalCache internalCache) {
    Set<DistributedRegion> result = new HashSet<>();
    for (InternalRegion r : internalCache.getAllRegions()) {
      if (r instanceof DistributedRegion) {
        result.add((DistributedRegion) r);
      }
    }
    return result;
  }
set the hasCacheServer flags for all regions in this cache
geode-core/src/main/java/org/apache/geode/internal/cache/AddCacheServerProfileMessage.java