|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.eviction.BaseEvictionAlgorithm
public abstract class BaseEvictionAlgorithm
Abstract Event Processing Eviction Algorithm. This class is used to implement basic event processing for Eviction Algorithms. To extend this abstract class to make an Eviction Algorithm, implement the abstract methods and a policy.
Field Summary | |
---|---|
protected EvictionQueue |
evictionQueue
Contains NodeEntry instances. |
protected java.util.concurrent.BlockingQueue<Fqn> |
recycleQueue
Contains Fqn instances. |
protected Region |
region
Mapped region. |
Constructor Summary | |
---|---|
protected |
BaseEvictionAlgorithm()
|
Method Summary | |
---|---|
protected void |
emptyRecycleQueue()
Empty the Recycle Queue. |
protected void |
evict(NodeEntry ne)
|
protected boolean |
evictCacheNode(Fqn fqn)
Evict a node from cache. |
EvictionQueue |
getEvictionQueue()
Get the underlying EvictionQueue implementation. |
protected void |
initialize(Region region)
|
protected boolean |
isNodeInUseAndNotTimedOut(NodeEntry ne)
|
void |
process(Region region)
Process the given region. |
protected void |
processAddedElement(Fqn fqn)
|
protected void |
processAddedNodes(Fqn fqn,
int numAddedElements,
boolean resetElementCount)
|
protected void |
processMarkInUseNodes(Fqn fqn,
long inUseTimeout)
|
protected void |
processQueues(Region region)
Event processing for Evict/Add/Visiting of nodes. |
protected void |
processRemovedElement(Fqn fqn)
|
protected void |
processRemovedNodes(Fqn fqn)
Remove a node from cache. |
protected void |
processUnmarkInUseNodes(Fqn fqn)
|
protected void |
processVisitedNodes(Fqn fqn)
Visit a node in cache. |
protected void |
prune()
|
void |
resetEvictionQueue(Region region)
Reset the whole eviction queue. |
protected abstract EvictionQueue |
setupEvictionQueue(Region region)
This method will create an EvictionQueue implementation and prepare it for use. |
protected abstract boolean |
shouldEvictNode(NodeEntry ne)
This method will check whether the given node should be evicted or not. |
java.lang.String |
toString()
Returns debug information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Region region
protected java.util.concurrent.BlockingQueue<Fqn> recycleQueue
protected EvictionQueue evictionQueue
Constructor Detail |
---|
protected BaseEvictionAlgorithm()
Method Detail |
---|
protected abstract EvictionQueue setupEvictionQueue(Region region) throws EvictionException
region
- MarshRegion to setup an eviction queue for.
EvictionException
EvictionQueue
protected abstract boolean shouldEvictNode(NodeEntry ne)
ne
- NodeEntry to test eviction for.
protected void initialize(Region region) throws EvictionException
EvictionException
public void process(Region region) throws EvictionException
process
in interface EvictionAlgorithm
region
- Cache region to process for eviction.
EvictionException
public void resetEvictionQueue(Region region)
EvictionAlgorithm
resetEvictionQueue
in interface EvictionAlgorithm
region
- MarshRegion that this algorithm will operate on.public EvictionQueue getEvictionQueue()
getEvictionQueue
in interface EvictionAlgorithm
EvictionQueue
protected void processQueues(Region region) throws EvictionException
region
- Cache region to process for eviction.
EvictionException
protected void evict(NodeEntry ne)
protected boolean evictCacheNode(Fqn fqn)
fqn
- node corresponds to this fqn
protected void processMarkInUseNodes(Fqn fqn, long inUseTimeout) throws EvictionException
EvictionException
protected void processUnmarkInUseNodes(Fqn fqn) throws EvictionException
EvictionException
protected void processAddedNodes(Fqn fqn, int numAddedElements, boolean resetElementCount) throws EvictionException
EvictionException
protected void processRemovedNodes(Fqn fqn) throws EvictionException
fqn
- FQN of the removed node
EvictionException
protected void processVisitedNodes(Fqn fqn) throws EvictionException
fqn
- FQN of the visited node.
EvictionException
protected void processRemovedElement(Fqn fqn) throws EvictionException
EvictionException
protected void processAddedElement(Fqn fqn) throws EvictionException
EvictionException
protected void emptyRecycleQueue() throws EvictionException
EvictionException
protected boolean isNodeInUseAndNotTimedOut(NodeEntry ne)
protected void prune() throws EvictionException
EvictionException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |