org.jboss.cache.eviction
Class LRUAlgorithm
java.lang.Object
org.jboss.cache.eviction.LRUAlgorithm
- All Implemented Interfaces:
- EvictionAlgorithm (src)
- Direct Known Subclasses:
- AopLRUAlgorithm (src) , FIFOAlgorithm (src)
- public class LRUAlgorithm
- extends java.lang.Object
- implements EvictionAlgorithm (src)
Least recently Used algorithm to purge old data.
Note that this algorithm is not thread-safe.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log_
protected Logger (src) log_
nodeMap_
protected java.util.Map nodeMap_
head_
protected NodeEntry (src) head_
tail_
protected NodeEntry (src) tail_
region_
protected Region (src) region_
recycleQueue_
protected BoundedBuffer recycleQueue_
LRUAlgorithm
public LRUAlgorithm()
process
public void process(Region (src) region)
throws EvictionException (src)
- No lock is used here since we assume it is single-threaded access by the timer only.
- Specified by:
process
in interface EvictionAlgorithm (src)
- Parameters:
region
-
- Throws:
EvictionException (src)
resetEvictionQueue
public void resetEvictionQueue(Region (src) region)
- Description copied from interface:
EvictionAlgorithm (src)
- Reset the whole eviction queue. Queue may needs to be reset due to corrupted state, for example.
- Specified by:
resetEvictionQueue
in interface EvictionAlgorithm (src)
- Parameters:
region
- Region that this algorithm will operate on.
demote
protected void demote(Fqn (src) fqn)
throws EvictionException (src)
- Throws:
EvictionException (src)
prune
protected void prune()
throws EvictionException (src)
- Throws:
EvictionException (src)
evict
protected void evict(Fqn (src) fqn)
throws EvictionException (src)
- Throws:
EvictionException (src)
evictionQueueSize
public int evictionQueueSize()