public abstract class CacheUtils
extends java.lang.Object
ClientCache
and peer Cache
instances.Cache
,
DataPolicy
,
Region
,
RegionAttributes
,
RegionService
,
ClientCache
,
Pool
Constructor and Description |
---|
CacheUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Collection<T> |
collectValues(org.apache.geode.cache.Region<?,T> region)
Collects all
values from the given Region . |
static boolean |
isClientCache(org.apache.geode.cache.RegionService regionService)
Null-safe method to determine whether the given
RegionService is an instance of ClientCache . |
static boolean |
isClientRegion(org.apache.geode.cache.Region<?,?> region)
Null-safe method to determine whether the given
Region is a client Region
in a ClientCache . |
static boolean |
isPeerCache(org.apache.geode.cache.RegionService regionService)
Null-safe method to determine whether the given
RegionService is an instance of
a peer Cache . |
static boolean |
isPeerRegion(org.apache.geode.cache.Region<?,?> region)
Null-safe method to determine whether the given
Region is a peer Region
in a peer Cache . |
static boolean |
isProxyRegion(org.apache.geode.cache.Region<?,?> region)
Null-safe method to determine whether the given
Region is a [client] PROXY Region . |
static boolean |
isRegionWithPool(org.apache.geode.cache.Region<?,?> region)
Null-safe method to determine whether the given
Region was configured with a Pool . |
public static <T> java.util.Collection<T> collectValues(org.apache.geode.cache.Region<?,T> region)
values
from the given Region
.
This method is capable of pulling values
from either client
or peer Regions
.T
- type
of the Region
values
.region
- Region
from which to collect the values
.Collection
of all values
from the given Region
.java.lang.IllegalArgumentException
- if Region
is null.Region
,
Collection
public static boolean isClientCache(org.apache.geode.cache.RegionService regionService)
RegionService
is an instance of ClientCache
.
The problem is, GemFireCacheImpl
implements both the (peer) Cache
and ClientCache
interfaces. #sighregionService
- RegionService
to evaluate.RegionService
an instance of ClientCache
.ClientCache
,
RegionService
public static boolean isClientRegion(org.apache.geode.cache.Region<?,?> region)
Region
is a client Region
in a ClientCache
.region
- Region
to evaluate.Region
is a client Region
.Region
,
isClientCache(RegionService)
public static boolean isPeerCache(org.apache.geode.cache.RegionService regionService)
RegionService
is an instance of
a peer Cache
.
The problem is, GemFireCacheImpl
implements both the (peer) Cache
and ClientCache
interfaces. #sighregionService
- RegionService
to evaluate.RegionService
is an instance of
a peer Cache
.RegionService
,
Cache
public static boolean isPeerRegion(org.apache.geode.cache.Region<?,?> region)
Region
is a peer Region
in a peer Cache
.region
- Region
to evaluate.Region
is a peer Region
.Region
,
isPeerCache(RegionService)
public static boolean isProxyRegion(org.apache.geode.cache.Region<?,?> region)
Region
is a [client] PROXY Region
.
The Region
is a PROXY if the DataPolicy
is DataPolicy.EMPTY
or the Region
has a configured Pool
.region
- Region
to evaluate.Region
is a [client] PROXY Region
.Region
,
isRegionWithPool(Region)
public static boolean isRegionWithPool(org.apache.geode.cache.Region<?,?> region)
Region
was configured with a Pool
.
A Region
configured with a Pool
(by name
specified in the RegionAttributes
)
is a strong indicator that the Region
is a client Region
.region
- Region
to evaluate.Region
was configured with a Pool
.Pool
,
Region