|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j_spaces.map.eviction.AbstractEvictionStrategy
com.j_spaces.map.eviction.LFUEvictionStrategy
public class LFUEvictionStrategy
The heap LFUDA ( Least Frequently Used) policy keeps popular objects in cache regardless of their size and thus optimizes byte hit rate at the expense of hit rate since one large, popular object will prevent many smaller, slightly less popular objects from being cached.
Constructor Summary | |
---|---|
LFUEvictionStrategy()
|
Method Summary | |
---|---|
void |
clear()
Clear EvictionStrategy internal structures only and doesn't clear cache. |
CacheEntry |
createEntry(Object key,
Object value,
long ttl,
int version)
Creates new CacheEntry for the Cache and probably saves the entry in the internal structures. |
void |
discardEntry(CacheEntry entry)
Discard an Entry from the EvictionStrategy internal structures. |
int |
evict(Cache cache)
Evicts batch of CacheEntry from the Cache according to the eviction strategy. |
void |
touchEntry(CacheEntry entry)
Informs the eviction strategy on a CacheEntry use. |
Methods inherited from class com.j_spaces.map.eviction.AbstractEvictionStrategy |
---|
setBatchSize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LFUEvictionStrategy()
Method Detail |
---|
public void clear()
public void discardEntry(CacheEntry entry)
entry
- the entry to discard from the eviction strategy internal structurespublic int evict(Cache cache)
cache
- the cache to be evicted
public void touchEntry(CacheEntry entry)
entry
- the touched entrypublic CacheEntry createEntry(Object key, Object value, long ttl, int version)
key
- the entry keyvalue
- the entry valuettl
- the time to keep the entry in cacheversion
- the entry version
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |