|
||||||||||
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 boolean |
allowTombstones
|
protected EvictionQueue |
evictionQueue
Contains NodeEntry instances. |
protected 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)
|
protected boolean |
isYoungerThanMinimumTimeToLive(NodeEntry entry)
Tests whether a node entry is younger than the minimum time to live - if one is configured. |
void |
process(Region region)
Process the given region. |
protected void |
processAddedElement(EvictedEventNode evictedEventNode)
|
protected void |
processAddedNodes(EvictedEventNode evictedEventNode)
Convenience method, which calls processAddedNodes(EvictedEventNode, int, boolean) using values in the
evictedEventNode for number of added elements and the resetElementCount flag. |
protected void |
processAddedNodes(EvictedEventNode evictedEventNode,
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(EvictedEventNode evictedEventNode)
|
protected void |
processRemovedNodes(EvictedEventNode evictedEventNode)
Remove a node from cache. |
protected void |
processUnmarkInUseNodes(Fqn fqn)
|
protected void |
processVisitedNodes(EvictedEventNode evictedEventNode)
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. |
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 BlockingQueue<Fqn> recycleQueue
protected EvictionQueue evictionQueue
protected boolean allowTombstones
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(EvictedEventNode evictedEventNode) throws EvictionException
processAddedNodes(EvictedEventNode, int, boolean)
using values in the
evictedEventNode for number of added elements and the resetElementCount flag.
evictedEventNode
- an evictedEventNode to process
EvictionException
- on problemsprotected void processAddedNodes(EvictedEventNode evictedEventNode, int numAddedElements, boolean resetElementCount) throws EvictionException
EvictionException
protected void processRemovedNodes(EvictedEventNode evictedEventNode) throws EvictionException
EvictionException
protected void processVisitedNodes(EvictedEventNode evictedEventNode) throws EvictionException
EvictionException
protected void processRemovedElement(EvictedEventNode evictedEventNode) throws EvictionException
EvictionException
protected void processAddedElement(EvictedEventNode evictedEventNode) throws EvictionException
EvictionException
protected void emptyRecycleQueue() throws EvictionException
EvictionException
protected boolean isNodeInUseAndNotTimedOut(NodeEntry ne)
protected void prune() throws EvictionException
EvictionException
public String toString()
toString
in class Object
protected boolean isYoungerThanMinimumTimeToLive(NodeEntry entry)
entry
- the node entry being examined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |