You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Zhang, Ying" <Yi...@thomson.com> on 2003/09/18 16:39:03 UTC

Question on MemoryStore and Caching

Hello,

Can anyone provide kind help on this?

This is Ying, a Java developer working in US. I am doing some research to
bring in a style-sheet caching approach in our existing framework. 
I noticed that in the Apache Cocoon release 1.5, you have a method
"evaluate" in the org.apache.cocoon.components.store.MemoryStore class,
which provides a caching evaluation algorithm based on both LRU and LFU. I'd
like to look more into this.  
    private long evaluate(Container c, long time) {
        return (factor * c.count) + (Long.MAX_VALUE >> 1) - (time - c.time);
    }
However, class MemoryStore was deprecated from cocoon since release 2.0.
Even though I can find a counter part class in the Avalon Excalibur source
code release, i.e. org.apache.excalibur.store.impl.MemoryStore. However,  a
corresponding evaluate method is removed.
Questiona for anyone who has experience using Cocoon MemoryStore or knows
about the history.  
	Could you please indicate where I can find this evaluate method (or
other name providing similar functionality) in the latest Avalon Excalibur
release? 
	If it is no longer supported, what is the main reason? The detect of
the algorithm or a better solution has been identified?
	Could you recommend other caching algorithms used well in the
industry?
	If this algorithm is still being used, any comment on the algorithm
itself and tips for setting the factor are much appreciated too.
With million thanks,

Ying Zhang
Sr. Software Engineer
Thomson West, Eagan, MN 55124
(651)648-8785






Re: Question on MemoryStore and Caching

Posted by Vadim Gritsenko <va...@verizon.net>.
Zhang, Ying wrote:

>Hello,
>
>Can anyone provide kind help on this?
>
>This is Ying, a Java developer working in US. I am doing some research to
>bring in a style-sheet caching approach in our existing framework. 
>I noticed that in the Apache Cocoon release 1.5, you have a method
>"evaluate" in the org.apache.cocoon.components.store.MemoryStore class,
>which provides a caching evaluation algorithm based on both LRU and LFU. I'd
>like to look more into this.  
>    private long evaluate(Container c, long time) {
>        return (factor * c.count) + (Long.MAX_VALUE >> 1) - (time - c.time);
>    }
>However, class MemoryStore was deprecated from cocoon since release 2.0.
>  
>

Zhang,

This class is not deprecated in 2.0, and it is completely removed in 2.1.


>Even though I can find a counter part class in the Avalon Excalibur source
>code release, i.e. org.apache.excalibur.store.impl.MemoryStore. However,  a
>corresponding evaluate method is removed.
>  
>

To the best of my knowledge, evaluate() method was never part of 
MemoryStore class in all 2.0 releases, including pre-releases.


>Questiona for anyone who has experience using Cocoon MemoryStore or knows
>about the history.
>

http://cvs.apache.org/viewcvs.cgi/cocoon-2-historical/src/org/apache/cocoon/components/store/Attic/MemoryStore.java?hideattic=0
http://cvs.apache.org/viewcvs.cgi/cocoon-2-historical/src/java/org/apache/cocoon/components/store/Attic/MemoryStore.java?hideattic=0


>	Could you please indicate where I can find this evaluate method (or
>other name providing similar functionality) in the latest Avalon Excalibur
>release? 
>	If it is no longer supported, what is the main reason? The detect of
>the algorithm or a better solution has been identified?
>	Could you recommend other caching algorithms used well in the
>industry?
>	If this algorithm is still being used, any comment on the algorithm
>itself and tips for setting the factor are much appreciated too.
>  
>

No, it is not used, and it has never been used in Cocoon 2.0+, and 
MemoryStore was not used for a long time too, as it has been replaced by 
MRUMemoryStore.

Vadim