How easy would it be to implement DataObject.getSize() which returns
the size of the DataObject in bytes? Once we implement that it should be
extremely easy to add support for max cache size in terms of bytes as
well as max cache time (maximum time a value is cached, regardless of
when it was last accessed) and max idle time (maximum time a value is
cached depending on when it was last accessed).
See http://www.vipan.com/htdocs/cachehelp.html for an example of how
they implemented TTL. Also, as of JDK 1.4 LinkedHashMap provides LRU
support so depending or not on whether Cayenne requires JDK 1.4 we can
drop the apache version in favor of this more standard one.
So how hard would be it be to implement DataObject.getSize()? :)
Thanks,
Gili
Tore Halset wrote:
> On Aug 28, 2005, at 8:09, Gili wrote:
>
>> I can see one can configure the maximum number of objects cached
>> across a DataDomain but I don't see how one can configure the maximum
>> cache size in terms of bytes or how many of each kind of DataNode may
>> be cached. I mean, if the cache consists of 10,000 objects but I
>> don't get to control which objects these are this could range
>> anywhere from 10,000 bytes to 10,000 MB for me. That's a pretty big
>> range! :)
>
>
> You are correct. The current cache are limited by the number of
> objects. Tha map used is LRUMap:
>
> http://jakarta.apache.org/commons/collections/apidocs/org/apache/
> commons/collections/map/LRUMap.html
>
>> Is there a way to better control the cache?
>
>
> Probably.. I think you will have to provide a java.util.Map
> implementation that works the way you want.
>
> Regards,
> - Tore.
>
-- http://www.desktopbeautifier.com/
This archive was generated by hypermail 2.0.0 : Sun Aug 28 2005 - 12:26:34 EDT