Extending the cache functionality

From: Gili (cowwo..bs.darktech.org)
Date: Mon Aug 29 2005 - 01:14:10 EDT

  • Next message: Gili: "ant test fails"

            I can quite easily extend our LRU map to add TTL and max-idle values
    per entries stores within. In my application, for example, I want to be
    able to say that image objects should be cached for a maximum of 5 minutes.

            Originally I had requested a feature that allows us to specify the
    maximum cache size in terms of bytes but look back at EHCache (used by
    Hibernate) it doesn't allow this either. Still, I think this would be
    worthwhile to add if we can do so efficiently because the bottom line is
    end-users don't care how many objects exist in the cache, what they
    *really* want to configure is the total memory usage of the cache.

            The question is, how difficult would it be for you to implement
    DataObject.size() which returns the size of any given DataObject in
    bytes? This wouldn't have to be 100% exact (we could fine-tune the
    result over future releases) but I think it should be relatively easy
    (and quick) to return an approximate value by iterating through the
    DataRows making up any given DataObject and suming up each individual
    column size contribution.

            What do you think?

    Thanks,
    Gili

    -- 
    http://www.desktopbeautifier.com/
    



    This archive was generated by hypermail 2.0.0 : Mon Aug 29 2005 - 01:14:12 EDT