/** * Given a RegionFunctionContext {@linkplain RegionFunctionContext#getDataSet() * for a partitioned Region}, return a map of {@linkplain PartitionAttributesFactory#setColocatedWith(String) colocated Regions} * with read access limited to the context of the function. * <p> * Writes using these Region have no constraints and behave the same as a partitioned Region. * <p> * If there are no colocated regions, return an empty map. * * @param c the region function context * @throws IllegalStateException if the Region is not a {@linkplain DataPolicy#PARTITION partitioned Region} * @return an unmodifiable map of {@linkplain Region#getFullPath() region name} to {@link Region} * @since 6.0 */ public static Map<String, Region<?, ?>> getLocalColocatedRegions(final RegionFunctionContext c) { final Region r = c.getDataSet(); isPartitionedCheck(r); final InternalRegionFunctionContext rfci = (InternalRegionFunctionContext)c; Map ret = rfci.getColocatedLocalDataSets(); return ret; }
/** * Given a RegionFunctionContext {@linkplain RegionFunctionContext#getDataSet() * for a partitioned Region}, return a map of {@linkplain PartitionAttributesFactory#setColocatedWith(String) colocated Regions} * with read access limited to the context of the function. * <p> * Writes using these Region have no constraints and behave the same as a partitioned Region. * <p> * If there are no colocated regions, return an empty map. * * @param c the region function context * @throws IllegalStateException if the Region is not a {@linkplain DataPolicy#PARTITION partitioned Region} * @return an unmodifiable map of {@linkplain Region#getFullPath() region name} to {@link Region} * @since 6.0 */ public static Map<String, Region<?, ?>> getLocalColocatedRegions(final RegionFunctionContext c) { final Region r = c.getDataSet(); isPartitionedCheck(r); final InternalRegionFunctionContext rfci = (InternalRegionFunctionContext)c; Map ret = rfci.getColocatedLocalDataSets(); return ret; }