Class EvictionAttributesFactoryBean
java.lang.Object
org.springframework.data.gemfire.eviction.EvictionAttributesFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.EvictionAttributes>
,org.springframework.beans.factory.InitializingBean
public class EvictionAttributesFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.EvictionAttributes>, org.springframework.beans.factory.InitializingBean
Simple utility class used for defining nested factory-method like definitions w/o polluting the container with useless beans.
- See Also:
-
FactoryBean
InitializingBean
EvictionAttributes
ObjectSizer
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
org.apache.geode.cache.EvictionAction
Gets the action performed on the Region when Eviction occurs.org.apache.geode.cache.EvictionAttributes
org.apache.geode.cache.util.ObjectSizer
Gets the GemFire ObjectSizer used in determining object sizes of data stored in the Cache.Class<?>
Get the threshold used by the LRU algorithm in ENTRY_COUNT and MEMORY_SIZE eviction policy.getType()
Gets the eviction policy and algorithm used by the Region.boolean
void
setAction
(org.apache.geode.cache.EvictionAction action) Sets the action to perform on the Region when Eviction occurs.void
setObjectSizer
(org.apache.geode.cache.util.ObjectSizer objectSizer) Sets the GemFire ObjectSizer used in determining object sizes of data stored in the Cache.void
setThreshold
(Integer threshold) Set the threshold used by the LRU algorithm in ENTRY_COUNT and MEMORY_SIZE eviction policy.void
setType
(EvictionPolicyType type) Sets the type of eviction policy and algorithm (e.g.
-
Field Details
-
DEFAULT_LRU_MAXIMUM_ENTRIES
protected static final int DEFAULT_LRU_MAXIMUM_ENTRIES- See Also:
-
DEFAULT_MEMORY_MAXIMUM_SIZE
protected static final int DEFAULT_MEMORY_MAXIMUM_SIZE- See Also:
-
-
Constructor Details
-
EvictionAttributesFactoryBean
public EvictionAttributesFactoryBean()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
getObject
public org.apache.geode.cache.EvictionAttributes getObject()- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.EvictionAttributes>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.EvictionAttributes>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<org.apache.geode.cache.EvictionAttributes>
-
setAction
public void setAction(org.apache.geode.cache.EvictionAction action) Sets the action to perform on the Region when Eviction occurs.- Parameters:
action
- the specified EvictionAction taken on the Region.- See Also:
-
EvictionAction
-
getAction
public org.apache.geode.cache.EvictionAction getAction()Gets the action performed on the Region when Eviction occurs.- Returns:
- the EvictionAction taken on the Region.
- See Also:
-
EvictionAction
-
setObjectSizer
public void setObjectSizer(org.apache.geode.cache.util.ObjectSizer objectSizer) Sets the GemFire ObjectSizer used in determining object sizes of data stored in the Cache.- Parameters:
objectSizer
- the ObjectSizer used in sizing object data stored in the Cache.- See Also:
-
ObjectSizer
-
getObjectSizer
public org.apache.geode.cache.util.ObjectSizer getObjectSizer()Gets the GemFire ObjectSizer used in determining object sizes of data stored in the Cache.- Returns:
- the ObjectSizer used in sizing object data stored in the Cache.
- See Also:
-
ObjectSizer
-
setThreshold
Set the threshold used by the LRU algorithm in ENTRY_COUNT and MEMORY_SIZE eviction policy.- Parameters:
threshold
- an Integer value specifying the threshold used by the LRU algorithm when enforcing the eviction policy.
-
getThreshold
Get the threshold used by the LRU algorithm in ENTRY_COUNT and MEMORY_SIZE eviction policy.- Returns:
- an Integer value specifying the threshold used by the LRU algorithm when enforcing the eviction policy.
-
setType
Sets the type of eviction policy and algorithm (e.g. LRU on Entry Count, Heap % or Memory Size) to implement on the Region.- Parameters:
type
- the type of eviction policy/algorithm to implement on the Region.- See Also:
-
getType
Gets the eviction policy and algorithm used by the Region.- Returns:
- the eviction policy and algorithm in use by the Region.
- See Also:
-