... Think I found it. There is a bug in the documentation
(http://jakarta.apache.org/jcs/RegionProperties.html)

Instead of 'DiskUsagePattern' the property name should read
'DiskUsagePatternName'. The first one does accept short number, while
the second one maps string value to the short number. So, the line in
config file should read:

jcs.default.cacheattributes.DiskUsagePatternName = UPDATE

Thanks. It seems to work now. I wonder if 'UPDATE' policy is set, does
'MaxPurgatorySize' property has any effect then? What's the lifecycle of
cache element with UPDATE policy? Does it go just between 'memory' and
'dc'? (if not found in memory, load from disk and put in memory cache,
expiring some entries from memory on the way if necessary)?

-----Original Message-----
From: Vladimir Olenin [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 28, 2006 9:15 AM
To: JCS Users List
Subject: RE: configuration question

Trying to do this as per docs, with line

jcs.default.cacheattributes.DiskUsagePattern = UPDATE

But getting this in the output log:

[WARN] Failed to set property diskUsagePattern to value "UPDATE".
Conversion to type [short] failed.


I think 'UPDATE' is a final short variable somewhere in the code.... But
there is no referral to it in the guides. What should it be?

-----Original Message-----
From: Aaron Smuts [mailto:[EMAIL PROTECTED]
Sent: Friday, August 25, 2006 8:21 PM
To: JCS Users List
Subject: Re: configuration question

Purgatory is a queue on which items on the way to disk can still be
accessed.  Setting a limit on purgatory allows you to prevent the queue
from getting too large.  If you set a purgatory to 1000 and then quickly
add 100,000 items faster than they can be written to disk, then the
queue will certainly hit 1000.  When the max purgatory size is reached
the oldest are dropped.  

Purgatory is basically a bounded queue with a map on top.  There is a
bit more description here:

http://jakarta.apache.org/jcs/IndexedDiskAuxCache.html

You should probably run with the cacheattributes properly called
DiskUsagePatternName=UPDATE.  This will cause the items to go to disk
when they are added to the cache instead of when they fall out of the
Memory cache.

If you are going to flood the cache with items, then don't set a
purgatory limit, or set it to the number you will be adding if it is
known.

Aaron

--- Vladimir Olenin <[EMAIL PROTECTED]> wrote:

> Hi.
>  
> I need to configure JCS in the following manner:
>  
> - need to load 100K entries into the cache
> - NONE of the entries are allowed to be expired (ie, ALL must be
> eternal)
> - have to keep in memory not more than 1000 entries at a time
> - the rest entries should be swapped to disk automatically
>  
> What is the default setting that would work the best? The current 
> configuration I use is below and it seem to work. I can't quite figure

> out the meaning of 'MaxPurgatorySize' property. From the docs I 
> understood that it's just the size of the 'disk purge' queue. But the 
> tests show that if it's a positive number, then the entries start to 
> be 'expired' from the cache (eg, if set to 1000 it seems like only a 
> small fraction of 100K entries remains in cache and some of the 
> entries put in the cache become missing for sure, since jcs.get 
> returns null).
>  
> Thanks!.
>  
> ===========================================
> jcs.default = DC_SMALL_FOOTPRINT
> jcs.default.cacheattributes =
> org.apache.jcs.engine.CompositeCacheAttributes
> jcs.default.cacheattributes.MaxObjects = 1000 
> jcs.default.cacheattributes.MemoryCacheName = 
> org.apache.jcs.engine.memory.lru.LRUMemoryCache
>  
>
jcs.auxiliary.DC_SMALL_FOOTPRINT=org.apache.jcs.auxiliary.disk.indexed.I
> ndexedDiskCacheFactory
>
jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes=org.apache.jcs.auxiliary.dis
> k.indexed.IndexedDiskCacheAttributes
>
jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.DiskPath=c:/Projects/Grouper
> /temp/jcs
>
jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.maxKeySize=-1
>
jcs.auxiliary.DC_SMALL_FOOTPRINT.attributes.MaxPurgatorySize=-1
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to