public class BoundedMultiLruCache extends MultiLruCache
BaseCache.CacheItem| Modifier and Type | Field and Description |
|---|---|
protected long |
currentSize |
protected long |
maxSize |
DEFAULT_HASHTABLE_SEGMENT_SIZE, listsLength, LRU_HEAD, LRU_TAIL_rb, bucketLocks, buckets, entryCount, listeners, maxBuckets, refreshFlags, threshold| Constructor and Description |
|---|
BoundedMultiLruCache() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
decrementCurrentSize(int size) |
Object |
getStatByName(String key)
get the desired statistic counter
|
Map |
getStats()
get the stats snapshot
|
protected void |
incrementCurrentSize(int size)
synchronized counter updates
|
void |
init(int maxCapacity,
Properties props)
initialize the LRU cache
|
protected boolean |
isThresholdReached()
has cache reached its threshold
|
protected BaseCache.CacheItem |
itemAdded(BaseCache.CacheItem item)
this item is just added to the cache
|
protected void |
itemRefreshed(BaseCache.CacheItem item,
int oldSize)
item value has been refreshed
|
protected void |
itemRemoved(BaseCache.CacheItem item)
item value has been removed from the cache
|
createItem, handleOverflow, incrementTrimIndex, itemAccessed, trimLru_put, _remove, _removeItem, add, add, addCacheListener, clear, clearStats, contains, decrementEntryCount, destroy, elements, eq, get, get, getAll, getEntryCount, getIndex, getIndex, hash, incrementAddCount, incrementEntryCount, incrementHitCount, incrementMissCount, incrementOverflowCount, incrementRefreshCount, incrementRemovalCount, init, isEmpty, keys, loadValue, notifyRefresh, put, put, remove, remove, remove, removeAll, trimExpiredEntries, trimItem, values, waitRefreshpublic void init(int maxCapacity,
Properties props)
throws Exception
init in interface Cacheinit in class MultiLruCachemaxCapacity - maximum number of entries this cache may holdprops - opaque list of properties for a given cache implementationExceptionprotected BaseCache.CacheItem itemAdded(BaseCache.CacheItem item)
itemAdded in class MultiLruCacheitem - CacheItem that was createdCache bucket is already synchronized by the caller
protected void itemRefreshed(BaseCache.CacheItem item, int oldSize)
itemRefreshed in class MultiLruCacheitem - CacheItem that was refreshedoldSize - size of the previous value that was refreshed
Cache bucket is already synchronized by the callerprotected void itemRemoved(BaseCache.CacheItem item)
itemRemoved in class MultiLruCacheitem - CacheItem that was just removed
Cache bucket is already synchronized by the caller
protected boolean isThresholdReached()
isThresholdReached in class BaseCacheprotected final void incrementCurrentSize(int size)
protected final void decrementCurrentSize(int size)
public Object getStatByName(String key)
getStatByName in interface CachegetStatByName in class MultiLruCachekey - to corresponding statpublic Map getStats()
MultiLruCachegetStats in interface CachegetStats in class MultiLruCacheCopyright © 2006–2018 TinyGroup. All rights reserved.