Class EvictionConfiguration.EvictionPolicyMetaData
java.lang.Object
org.springframework.data.gemfire.config.annotation.EvictionConfiguration.EvictionPolicyMetaData
- All Implemented Interfaces:
EvictionConfiguration.EvictionPolicyConfigurer
- Enclosing class:
- EvictionConfiguration
protected static class EvictionConfiguration.EvictionPolicyMetaData
extends Object
implements EvictionConfiguration.EvictionPolicyConfigurer
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
EvictionPolicyMetaData
(org.apache.geode.cache.EvictionAttributes evictionAttributes) Constructs an instance ofEvictionConfiguration.EvictionPolicyMetaData
initialized with the givenEvictionAttributes
applying to allRegions
.protected
EvictionPolicyMetaData
(org.apache.geode.cache.EvictionAttributes evictionAttributes, String[] regionNames) Constructs an instance ofEvictionConfiguration.EvictionPolicyMetaData
initialized with the givenEvictionAttributes
to apply to the specificRegions
. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Determines whether the givenObject
(e.g.protected boolean
Determine whether theRegion
identified by name is accepted for Eviction policy configuration.protected boolean
accepts
(org.apache.geode.cache.Region<?, ?> region) Determines whether the givenRegion
is accepted for Eviction policy configuration.Configure the Eviction policy on the given SDGClientRegionFactoryBean
orPeerRegionFactoryBean
used to create an Apache GeodeRegion
.org.apache.geode.cache.Region<?,
?> configure
(org.apache.geode.cache.Region<?, ?> region) Configures the Eviction policy of the given Apache GeodeRegion
.protected static EvictionConfiguration.EvictionPolicyMetaData
from
(org.springframework.core.annotation.AnnotationAttributes evictionPolicyAttributes, org.springframework.context.ApplicationContext applicationContext) protected static EvictionConfiguration.EvictionPolicyMetaData
from
(EnableEviction.EvictionPolicy evictionPolicy, org.springframework.context.ApplicationContext applicationContext) protected static EvictionConfiguration.EvictionPolicyMetaData
from
(EvictionPolicyType type, int maximum, EvictionActionType action, org.apache.geode.cache.util.ObjectSizer objectSizer, String... regionNames) protected static EvictionConfiguration.EvictionPolicyMetaData
protected org.apache.geode.cache.EvictionAttributes
Returns an instance of theEvictionAttributes
specifying the Eviction policy configuration captured in this Eviction policy meta-data.protected static org.apache.geode.cache.util.ObjectSizer
resolveObjectSizer
(String objectSizerName, org.springframework.context.ApplicationContext applicationContext) protected String
resolveRegionName
(Object regionFactoryBean) Resolves the name of a givenRegion
from the correspondingResolvableRegionFactoryBean
object.protected static Integer
resolveThreshold
(int maximum, EvictionPolicyType type) Resolves the Eviction policy threshold (a.k.a.protected EvictingRegionFactoryBean
setEvictionAttributes
(EvictingRegionFactoryBean regionFactoryBean) Sets theEvictionAttributes
on thePeerRegionFactoryBean
orClientRegionFactoryBean
used to create the targetedRegion
.
-
Field Details
-
ALL_REGIONS
-
-
Constructor Details
-
EvictionPolicyMetaData
protected EvictionPolicyMetaData(org.apache.geode.cache.EvictionAttributes evictionAttributes) Constructs an instance ofEvictionConfiguration.EvictionPolicyMetaData
initialized with the givenEvictionAttributes
applying to allRegions
.- Parameters:
evictionAttributes
-EvictionAttributes
specifying the Eviction policy configuration for aRegion
.- See Also:
-
EvictionAttributes
EvictionPolicyMetaData(EvictionAttributes, String[])
-
EvictionPolicyMetaData
protected EvictionPolicyMetaData(org.apache.geode.cache.EvictionAttributes evictionAttributes, String[] regionNames) Constructs an instance ofEvictionConfiguration.EvictionPolicyMetaData
initialized with the givenEvictionAttributes
to apply to the specificRegions
.- Parameters:
evictionAttributes
-EvictionAttributes
specifying the Eviction policy configuration for aRegion
.regionNames
- names ofRegions
on which the Eviction policy is applied.- See Also:
-
EvictionAttributes
-
-
Method Details
-
from
protected static EvictionConfiguration.EvictionPolicyMetaData from(@NonNull org.springframework.core.annotation.AnnotationAttributes evictionPolicyAttributes, @NonNull org.springframework.context.ApplicationContext applicationContext) -
from
protected static EvictionConfiguration.EvictionPolicyMetaData from(EnableEviction.EvictionPolicy evictionPolicy, org.springframework.context.ApplicationContext applicationContext) -
from
protected static EvictionConfiguration.EvictionPolicyMetaData from(EvictionPolicyType type, int maximum, EvictionActionType action, org.apache.geode.cache.util.ObjectSizer objectSizer, String... regionNames) -
fromDefaults
-
resolveObjectSizer
protected static org.apache.geode.cache.util.ObjectSizer resolveObjectSizer(String objectSizerName, org.springframework.context.ApplicationContext applicationContext) -
resolveThreshold
Resolves the Eviction policy threshold (a.k.a. maximum) based on theEvictionPolicyType
. For instanceEvictionPolicyType.HEAP_PERCENTAGE
does not support maximum/threshold since the settings are determined by the GemFire/Geode cache critical heap percentage and eviction heap percentage System property settings.- Parameters:
maximum
- integer value specifying the configured Eviction threshold.type
-EvictionPolicyType
specifying the type of Eviction algorithm.- Returns:
- a resolved value for the Eviction maximum/threshold.
- See Also:
-
accepts
Determines whether the givenObject
(e.g. Spring bean) is accepted for Eviction policy configuration. -
accepts
protected boolean accepts(@Nullable org.apache.geode.cache.Region<?, ?> region) Determines whether the givenRegion
is accepted for Eviction policy configuration.- Parameters:
region
-Region
evaluated for Eviction policy configuration.- Returns:
- a boolean value indicating whether the given
Region
is accepted for Eviction policy configuration. - See Also:
-
Region
accepts(Supplier)
-
accepts
Determine whether theRegion
identified by name is accepted for Eviction policy configuration.- Parameters:
regionName
- name of theRegion
targeted for Eviction policy configuration.- Returns:
- a boolean value if the named
Region
is accepted for Eviction policy configuration.
-
resolveRegionName
Resolves the name of a givenRegion
from the correspondingResolvableRegionFactoryBean
object.- Parameters:
regionFactoryBean
-ResolvableRegionFactoryBean
from which to resolve theRegion
name.- Returns:
- the resolved name of the
Region
created from the givenResolvableRegionFactoryBean
. - See Also:
-
setEvictionAttributes
protected EvictingRegionFactoryBean setEvictionAttributes(EvictingRegionFactoryBean regionFactoryBean) Sets theEvictionAttributes
on thePeerRegionFactoryBean
orClientRegionFactoryBean
used to create the targetedRegion
.- Parameters:
regionFactoryBean
-PeerRegionFactoryBean
orClientRegionFactoryBean
on which to set theEvictionAttributes
encapsulating the Eviction policy for the targetedRegion
.- Returns:
- the
regionFactoryBean
. - See Also:
-
getEvictionAttributes
protected org.apache.geode.cache.EvictionAttributes getEvictionAttributes()Returns an instance of theEvictionAttributes
specifying the Eviction policy configuration captured in this Eviction policy meta-data.- Returns:
- an instance of the
EvictionAttributes
specifying theRegion
Eviction policy configuration. - Throws:
IllegalStateException
- if theEvictionAttributes
were not properly initialized.- See Also:
-
EvictionAttributes
-
configure
Description copied from interface:EvictionConfiguration.EvictionPolicyConfigurer
Configure the Eviction policy on the given SDGClientRegionFactoryBean
orPeerRegionFactoryBean
used to create an Apache GeodeRegion
.- Specified by:
configure
in interfaceEvictionConfiguration.EvictionPolicyConfigurer
- Parameters:
regionBean
-ClientRegionFactoryBean
orPeerRegionFactoryBean
used to create an Apache GeodeRegion
.- Returns:
- the given
regionFactoryBean
. - See Also:
-
configure
public org.apache.geode.cache.Region<?,?> configure(org.apache.geode.cache.Region<?, ?> region) Description copied from interface:EvictionConfiguration.EvictionPolicyConfigurer
Configures the Eviction policy of the given Apache GeodeRegion
.- Specified by:
configure
in interfaceEvictionConfiguration.EvictionPolicyConfigurer
- Parameters:
region
-Region
on which to configure the Eviction policy.- Returns:
- the given
Region
. - See Also:
-
Region
-