Search in sources :

Example 6 with EvictionAction

use of org.apache.geode.cache.EvictionAction in project geode by apache.

the class CacheXmlParser method startLRUMemorySize.

/**
   * Start the configuration of a <code>lru-memory-size</code> eviction controller. Allow for any of
   * the attributes to be missing. Store the attributes on the stack anticipating the declaration of
   * an {@link ObjectSizer}.
   * 
   * @param atts
   */
private void startLRUMemorySize(Attributes atts) {
    String lruAction = atts.getValue(ACTION);
    EvictionAction action = EvictionAction.DEFAULT_EVICTION_ACTION;
    if (lruAction != null) {
        action = EvictionAction.parseAction(lruAction);
    }
    String maximum = atts.getValue(MAXIMUM);
    int max = MemLRUCapacityController.DEFAULT_MAXIMUM_MEGABYTES;
    if (maximum != null) {
        max = parseInt(maximum);
    }
    // Store for later addition of ObjectSizer, if any (the cast is for clarity sake)
    stack.push(EvictionAttributes.createLRUMemoryAttributes(max, null, action));
}
Also used : EvictionAction(org.apache.geode.cache.EvictionAction)

Aggregations

EvictionAction (org.apache.geode.cache.EvictionAction)6 InternalGemFireException (org.apache.geode.InternalGemFireException)1 Declarable (org.apache.geode.cache.Declarable)1 EvictionAlgorithm (org.apache.geode.cache.EvictionAlgorithm)1 ObjectSizer (org.apache.geode.cache.util.ObjectSizer)1 DiskWriteAttributesImpl (org.apache.geode.internal.cache.DiskWriteAttributesImpl)1 PartitionAttributesImpl (org.apache.geode.internal.cache.PartitionAttributesImpl)1 SizeClassOnceObjectSizer (org.apache.geode.internal.size.SizeClassOnceObjectSizer)1 AttributesImpl (org.xml.sax.helpers.AttributesImpl)1