public class LruCache<K,T> extends BaseCache<LruCache.Entry,K,T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LruCache.Entry<K,T> |
BaseCache.Info, BaseCache.MyTimerTask, BaseCache.TunablebulkCacheSource, bulkGetCnt, clearedTime, entryExpiryCalculator, evictedButInHashCnt, evictedCnt, evictionNeeded, exceptionExpiryCalculator, exceptionMaxLinger, experimentalBulkCacheSource, expiredKeptCnt, expiredRemoveCnt, fetchButHitCnt, fetchCnt, fetchExceptionCnt, fetchMillis, hashSeed, info, internalExceptionCnt, keyMutationCount, keyType, loadHitCnt, loadMissCnt, loadNonFreshAndFetchedCnt, loadNonFreshCnt, lock, mainHash, mainHashCtrl, manager, maximumBulkFetchSize, maxLinger, maxSize, name, newEntryCnt, peekHitNotFreshCnt, peekMissCnt, putCnt, putNewEntryCnt, refreshCnt, refreshHash, refreshHashCtrl, refreshHitCnt, refreshPool, refreshSubmitFailedCnt, removedCnt, shutdownInitiated, shutdownWaitFuture, source, startedTime, storage, suppressedExceptionCnt, timer, timerCancelCount, timerService, touchedTime, TUNABLE, valueType, virginEvictCnt, waitForClear| Constructor and Description |
|---|
LruCache() |
| Modifier and Type | Method and Description |
|---|---|
protected LruCache.Entry |
findEvictionCandidate()
Find an entry that should be evicted.
|
long |
getHitCnt() |
protected IntegrityState |
getIntegrityState() |
protected void |
initializeHeapCache() |
protected void |
insertIntoReplacementList(LruCache.Entry e)
New cache entry, put it in the replacement algorithm structure
|
protected LruCache.Entry |
newEntry()
Entry object factory.
|
protected void |
recordHit(LruCache.Entry e)
Record an entry hit.
|
calcNextRefreshTime, calculateHashEntryCount, checkClosed, checkCyclicListIntegrity, checkForGhost, checkIntegrity, clear, clearLocalCache, clearTimingStatistics, close, conditionallyStartProcess, contains, destroy, evictEventually, expireEntry, fetch, fetchFromSource, fetchWithStorage, flush, get, getAll, getAll, getBulk, getCompleteName, getCyclicListEntryCount, getEntry, getEntryInternal, getExpiredCnt, getExtraStatistics, getFetchesBecauseOfNewEntries, getFetchesInFlight, getInfo, getLatestInfo, getListEntryCount, getLocalSize, getLog, getName, getStorage, getTotalEntryCount, hasBackgroundRefreshAndServesExpiredValues, hasKeepAfterExpired, hasSharpTimeout, hasSuppressExceptions, init, insert, insert, insertAfterHeadCyclicList, insertEntryFromStorage, insertEntryFromStorage, insertFetched, insertInList, insertIntoHeadCyclicList, insertIntoTailCyclicList, insertOnPut, isClosed, iterateAllHeapEntries, iterateLocalAndStorage, iterator, lockAndRunForPurge, lookupEntry, lookupEntrySynchronized, lookupEntryUnsynchronized, lookupOrNewEntrySynchronized, modifiedHash, moveToFront, newEntry, peek, peekEntry, peekEntryInternal, prefetch, prefetch, prefetch, purge, put, putIfAbsent, remove, removeAllAtOnce, removeEntry, removeEntryFromReplacementList, removeFromCyclicList, removeFromCyclicList, removeFromList, removeWithFlag, resetStorage, returnEntry, returnValue, setBulkCacheSource, setCacheConfig, setCacheManager, setEntryExpiryCalculator, setExceptionExpiryCalculator, setExperimentalBulkCacheSource, setExpirySeconds, setFeatureBit, setName, setRefreshController, setSource, setSource, stopStartTimer, timerEvent, toString, updateShutdownWaitFuturepublic LruCache()
protected void recordHit(LruCache.Entry e)
BaseCacherecordHit in class BaseCache<LruCache.Entry,K,T>protected void insertIntoReplacementList(LruCache.Entry e)
BaseCacheinsertIntoReplacementList in class BaseCache<LruCache.Entry,K,T>protected LruCache.Entry newEntry()
BaseCachenewEntry in class BaseCache<LruCache.Entry,K,T>protected LruCache.Entry findEvictionCandidate()
BaseCacheBaseCache.removeEntryFromReplacementList(Entry)
if this entry will be really evicted. Pinned entries may be skipped. A
good eviction algorithm returns another candidate on sequential calls, even
if the candidate was not removed.
Rationale: Within the structure lock we can check for an eviction candidate
and may remove it from the list. However, we cannot process additional operations or
events which affect the entry. For this, we need to acquire the lock on the entry
first.findEvictionCandidate in class BaseCache<LruCache.Entry,K,T>protected void initializeHeapCache()
initializeHeapCache in class BaseCache<LruCache.Entry,K,T>protected IntegrityState getIntegrityState()
getIntegrityState in class BaseCache<LruCache.Entry,K,T>cache2k API documentation. Copyright © 2000–2015 headissue GmbH, Munich.