You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by AJ Weber <aw...@comcast.net> on 2007/02/02 18:52:03 UTC

Newbie: persistent/non-persistent and other quickies!

Obvious Newbie Q's.  Please forgive my initial ignorance...these are all non-distributed questions...

  1.. Is there a way to use the memory cache with the "IndexedDisk" as a backup/backing-store, such that on shutdown (or on next startup/initialization) the disk cache is entirely "flushed".  That is, everything is marked stale or deleted, etc.?
  2.. Can you programmatically setup the entire cache (memory and disk, etc.) from within your code so you theoretically eliminate the ccf-file entirely?  Just wondering...not sure it's a great idea or not....
  3.. I understand the cache works (solely?) on the "max number of objects" you want in the different parts of the cache (max-in-memory and max-on-disk).  What if your object sizes will vary _drastically_?  How can we limit the in-memory portion to a specific number of bytes?  For example, a ByteBuffer (mapped and read-into mem from a FileChannel) for a cached file?  Could be 10k, could be 100M each, entirely dependent upon filesize.  I could get an OutOfMemory exception pretty fast if my average file size calc is skewed or it changes over time.  (I think I saw someone else ask this, but I want to know if anyone else has ideas on how to get this to work.)
  4.. Has anyone done anything similar?  Read-in files that need quick random-access to a ByteBuffer or byte[] and used the JCS to cache them?  Experiences and gotchas' to share possibly?
Thank you all in advance,
AJ

Re: Newbie: persistent/non-persistent and other quickies!

Posted by Michael Stevens <ms...@etla.org>.
On Fri, Feb 02, 2007 at 12:52:03PM -0500, AJ Weber wrote:
>   2.. Can you programmatically setup the entire cache (memory and disk, etc.) from within your code so you theoretically eliminate the ccf-file entirely?  Just wondering...not sure it's a great idea or not....

This part is easy, you can generate the Properties object at runtime
and init with that.

I've done this in my code because I want to provide a GUI interface to
some of the cache configuration.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org