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
(EvictionAttributes evictionAttributes) Constructs an instance ofEvictionConfiguration.EvictionPolicyMetaData
initialized with the givenEvictionAttributes
applying to allRegions
.protected
EvictionPolicyMetaData
(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
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
.Region<?,
?> Configures the Eviction policy of the given Apache GeodeRegion
.protected static EvictionConfiguration.EvictionPolicyMetaData
from
(AnnotationAttributes evictionPolicyAttributes, ApplicationContext applicationContext) protected static EvictionConfiguration.EvictionPolicyMetaData
from
(EnableEviction.EvictionPolicy evictionPolicy, ApplicationContext applicationContext) protected static EvictionConfiguration.EvictionPolicyMetaData
from
(EvictionPolicyType type, int maximum, EvictionActionType action, ObjectSizer objectSizer, String... regionNames) protected static EvictionConfiguration.EvictionPolicyMetaData
protected EvictionAttributes
Returns an instance of theEvictionAttributes
specifying the Eviction policy configuration captured in this Eviction policy meta-data.protected static ObjectSizer
resolveObjectSizer
(String objectSizerName, 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. maximum) based on theEvictionPolicyType
.protected EvictingRegionFactoryBean
setEvictionAttributes
(EvictingRegionFactoryBean regionFactoryBean) Sets theEvictionAttributes
on thePeerRegionFactoryBean
orClientRegionFactoryBean
used to create the targetedRegion
.
-
Field Details
-
ALL_REGIONS
-
-
Constructor Details
-
EvictionPolicyMetaData
Constructs an instance ofEvictionConfiguration.EvictionPolicyMetaData
initialized with the givenEvictionAttributes
applying to allRegions
.- Parameters:
evictionAttributes
-EvictionAttributes
specifying the Eviction policy configuration for aRegion
.- See Also:
-
EvictionPolicyMetaData
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:
-
-
Method Details
-
from
protected static EvictionConfiguration.EvictionPolicyMetaData from(@NonNull AnnotationAttributes evictionPolicyAttributes, @NonNull ApplicationContext applicationContext) -
from
protected static EvictionConfiguration.EvictionPolicyMetaData from(EnableEviction.EvictionPolicy evictionPolicy, ApplicationContext applicationContext) -
from
protected static EvictionConfiguration.EvictionPolicyMetaData from(EvictionPolicyType type, int maximum, EvictionActionType action, ObjectSizer objectSizer, String... regionNames) -
fromDefaults
-
resolveObjectSizer
protected static ObjectSizer resolveObjectSizer(String objectSizerName, 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
Determines whether the givenRegion
is accepted for Eviction policy configuration. -
accepts
Determine whether theRegion
identified by name 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
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:
-
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
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:
-