public class LRUMemoryCache<K,V> extends AbstractDoubleLinkedListMemoryCache<K,V>
Even though there are only a few adjustments necessary to maintain the double linked list, we might want to find a more efficient memory manager for large cache regions.
The LRUMemoryCache is most efficient when the first element is selected. The smaller the region, the better the chance that this will be the case. < .04 ms per put, p3 866, 1/10 of that per get
list
Constructor and Description |
---|
LRUMemoryCache() |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustListForGet(MemoryElementDescriptor<K,V> me)
Makes the item the first in the list.
|
protected MemoryElementDescriptor<K,V> |
adjustListForUpdate(ICacheElement<K,V> ce)
Puts an item to the cache.
|
addFirst, addLast, createMap, freeElements, get, getKeySet, getStatistics, initialize, remove, removeAll, update
dispose, dumpMap, getCacheAttributes, getCacheName, getCompositeCache, getMultiple, getQuiet, getSize, getStatus, setCacheAttributes, waterfal
public LRUMemoryCache()
protected MemoryElementDescriptor<K,V> adjustListForUpdate(ICacheElement<K,V> ce) throws IOException
adjustListForUpdate
in class AbstractDoubleLinkedListMemoryCache<K,V>
ce
- The cache element, or entry wrapperIOException
protected void adjustListForGet(MemoryElementDescriptor<K,V> me)
adjustListForGet
in class AbstractDoubleLinkedListMemoryCache<K,V>
me
- Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.