cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <>
Subject Re: StoreJanitor
Date Thu, 05 Apr 2007 15:11:35 GMT
Ard Schrijvers wrote:
>> Strictly speaking, you don't need access to the eviction 
>> policy itself - but 
>> only some exposed method on Store, something like 
>> purgeLastElementAccordingToEvictionPolicy -- can't they add 
>> something like that? 
> I of course did ask this, because this is obviously the way to go: 
> summarizing Greg: "There is real way to plug into the eviction mechanism from outside."

I had a glance at LfuMemoryStore (extends MemoryStore) and found out that their 
LFU policy kicks least frequently used element out of small subset of *random* 
elements out of the memory store... It's possible though to modify it to evict 
LFU element on request.

LruMemoryStore uses LinkedHashMap which, if I read it correctly, can return LRU 
element using map.values().next(), which then can be kicked out.

So evict() can be implemented on MemoryStore, from what I see. Both of these 
store implementations though are completely synchronized and would perform worse 
than MRUBucketMap.


View raw message