public class LRUMemoryCache extends AbstractDoulbeLinkedListMemoryCache
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
AbstractDoulbeLinkedListMemoryCache.IteratorWrapper, AbstractDoulbeLinkedListMemoryCache.MapEntryWrapper
hitCnt, list, missCnt
Constructor and Description |
---|
LRUMemoryCache() |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustListForGet(MemoryElementDescriptor me)
Makes the item the first in the list.
|
protected MemoryElementDescriptor |
adjustListForUpdate(ICacheElement ce)
Puts an item to the cache.
|
addFirst, addLast, createMap, dumpCacheEntries, dumpCacheSize, dumpMap, freeElements, get, getIterator, getKeyArray, getStatistics, initialize, remove, removeAll, spoolLastElement, update, verifyCache
dispose, getCacheAttributes, getCacheName, getCompositeCache, getGroupKeys, getMultiple, getQuiet, getSize, getStatus, setCacheAttributes, waterfal
protected MemoryElementDescriptor adjustListForUpdate(ICacheElement ce) throws java.io.IOException
adjustListForUpdate
in class AbstractDoulbeLinkedListMemoryCache
ce
- The cache element, or entry wrapperjava.io.IOException
protected void adjustListForGet(MemoryElementDescriptor me)
adjustListForGet
in class AbstractDoulbeLinkedListMemoryCache
me
- Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.