Class IndexedDiskCache.LRUMapSizeLimited
java.lang.Object
org.apache.commons.jcs3.utils.struct.AbstractLRUMap<K,IndexedDiskElementDescriptor>
org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache.LRUMapSizeLimited
- All Implemented Interfaces:
Map<K,
IndexedDiskElementDescriptor>
- Enclosing class:
- IndexedDiskCache<K,
V>
public class IndexedDiskCache.LRUMapSizeLimited
extends AbstractLRUMap<K,IndexedDiskElementDescriptor>
Class for recycling and lru. This implements the LRU overflow callback, so we can add items
to the recycle bin. This class counts the size element to decide, when to throw away an element
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
processRemovedLRU
(K key, IndexedDiskElementDescriptor value) This is called when the may key size is reached.put
(K key, IndexedDiskElementDescriptor value) protected boolean
Methods inherited from class org.apache.commons.jcs3.utils.struct.AbstractLRUMap
clear, containsKey, containsValue, dumpCacheEntries, dumpMap, entrySet, get, getQuiet, getStatistics, isEmpty, keySet, putAll, size, values, verifyCache
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
TAG
tag
tells us which map we are working on.- See Also:
-
-
Constructor Details
-
LRUMapSizeLimited
public LRUMapSizeLimited()Default -
LRUMapSizeLimited
- Parameters:
maxKeySize
-
-
-
Method Details
-
put
- Specified by:
put
in interfaceMap<K,
IndexedDiskElementDescriptor> - Overrides:
put
in classAbstractLRUMap<K,
IndexedDiskElementDescriptor> - Returns:
- Object
-
remove
- Specified by:
remove
in interfaceMap<K,
IndexedDiskElementDescriptor> - Overrides:
remove
in classAbstractLRUMap<K,
IndexedDiskElementDescriptor> - Returns:
- Object removed
-
processRemovedLRU
This is called when the may key size is reached. The least recently used item will be passed here. We will store the position and size of the spot on disk in the recycle bin.- Overrides:
processRemovedLRU
in classAbstractLRUMap<K,
IndexedDiskElementDescriptor> - Parameters:
key
-value
-
-
shouldRemove
- Specified by:
shouldRemove
in classAbstractLRUMap<K,
IndexedDiskElementDescriptor>
-