What would be really nice to be able to do is to be able to separate the questions of:
"Do I need to evict?" and "What should I evict?" into different
responsibilities.... So that you could have an LRU eviction policy that evicts when a
certain memory threshold is reached, or a FIFO eviction policy that evicts when a certain
memory threshold is reached, or a MRU eviction policy that evicts when a certain memory
threshold is reached, etc - without having to code a completely separate eviction policy
for each.
Because all of the existing eviction policies assume that maxNodes is how to decide when
to evict, it's hard/impossible to put a memory threshold into an eviction policy
without also having to code the details of LRU/FIFO/MRU/etc.
I'm not really expecting anything to be magically done about this :-) , but I'd
like to see if you disagree with me or have any good ideas about an approach for this
(that doesn't involve wholesale changes in the org.jboss.cache.eviction package)
that's a bit more flexible than subclassing LRUAlgorithm to make a
LRUMemoryAwareAlgorithm, subclassing MRUAlgorithm to make MRUMemoryAwareAlgorithm, etc
(which wouldn't be hard, but would be less than ideal from a code maintenance
standpoint).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064763#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...