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 Tim Cronin <tc...@interwoven.com> on 2007/08/28 20:01:10 UTC

Best practice for linking Cache elements

We have a hierarchical structure of cache elements.

Sites contain pages and page contain components so
when we get a cache invalidation for a site we need to
flush all page and component entries for that site.

Our cache key is not a simple string.

I see there is grouping but comments in the code
say that this is going away. 



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


cache keys from disk cache after restart

Posted by Tim Cronin <tc...@interwoven.com>.
I can see that the load function is called upon process restart.

is there anyway to read the keys from the disk cache?

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


is something wrong with my config.

Posted by Tim Cronin <tc...@interwoven.com>.
I noticed the following in the cache info statement

219 [main] INFO control.CompositeCache  - Constructed cache with name
[component] and cache attributes [ useLateral = true, useRemote = true,
useDisk = true, maxObjs = 256, maxSpoolPerRun = 500, diskUsagePattern =
0 ]


but in my config:

jcs.region.component.elementattributes.IsRemote=false
jcs.region.component.elementattributes.IsLateral=false


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


RE: Best practice for linking Cache elements

Posted by Tim Cronin <tc...@interwoven.com>.
thanks I'm looking into that.

-----Original Message-----
From: Horton Simon [mailto:Simon.Horton@uk.mizuho-sc.com] 
Sent: Wednesday, August 29, 2007 6:25 AM
To: JCS Users List
Subject: RE: Best practice for linking Cache elements

Hi Tim,

If you are able to use a String instead of an object as a key you could
take advantage of the following JCS feature. If you have written your
code to use the JCS cache via your own utility helper class, you could
perform the toString conversion of your object key to a String key in
this one place and not have to touch the rest of your code.

Below is from am older response which Aaron gave on the email group to
somebody else and could be just what you are after.

Q: Can I remove multiple entries from Cache in a single go?

A:Yes, but it is somewhat expensive, since some of the auxiliaries will
have to iterate over their keysets.

Although all the auxiliaries honor this, it is not
        part of the auxiliary API.  There is no method along
        the lins of "removeStartingWith", but all the remove
        methods can do it.

        By default, the hierarchical key delimiter used in JCS
        is a colon.  You cannot add a String key that ends
        with a colon.  If you call remove with a String key
        that ends in a colon, everything that has a key that
        starts with the argument will be removed.

        If your keys are in this format

        TYPE:SOURCE:OBJECT

        And you put n objects in the cache with keys like this

        "ABC:123:0"  to "ABC:123:n"

        then you could remove all the obejcts by calling

        jcs.remove( "ABC:123:" );


Regards,
Simon


-----Original Message-----
From: Tim Cronin [mailto:tcronin@interwoven.com] 
Sent: Tuesday, August 28, 2007 7:01 PM
To: JCS Users List
Subject: Best practice for linking Cache elements

We have a hierarchical structure of cache elements.

Sites contain pages and page contain components so
when we get a cache invalidation for a site we need to
flush all page and component entries for that site.

Our cache key is not a simple string.

I see there is grouping but comments in the code
say that this is going away. 



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


This message and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this message in error please delete it
and any files transmitted with it, after notifying
postmaster@uk.mizuho-sc.com 
Any opinions expressed in this message may be those of the author and
not necessarily those of the company. The company accepts no
responsibility for the accuracy or completeness of any information
contained herein. This message is not intended to create legal relations
between the company and the recipient. 
Recipients should please note that messages sent via the Internet may be
intercepted and that caution should therefore be exercised before
dispatching to the company any confidential or sensitive information. 
Mizuho International plc Bracken House, One Friday Street, London EC4M
9JA. TEL. 020 72361090. Wholly owned subsidiary of Mizuho Securities
Co., Ltd. Member of Mizuho Financial Group. Authorised and regulated by
the Financial Services Authority. Member of the London Stock Exchange. 

Registered in England No. 1203696. Registered office as above.


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



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


RE: Best practice for linking Cache elements

Posted by Horton Simon <Si...@uk.mizuho-sc.com>.
Hi Tim,

If you are able to use a String instead of an object as a key you could
take advantage of the following JCS feature. If you have written your
code to use the JCS cache via your own utility helper class, you could
perform the toString conversion of your object key to a String key in
this one place and not have to touch the rest of your code.

Below is from am older response which Aaron gave on the email group to
somebody else and could be just what you are after.

Q: Can I remove multiple entries from Cache in a single go?

A:Yes, but it is somewhat expensive, since some of the auxiliaries will
have to iterate over their keysets.

Although all the auxiliaries honor this, it is not
        part of the auxiliary API.  There is no method along
        the lins of "removeStartingWith", but all the remove
        methods can do it.

        By default, the hierarchical key delimiter used in JCS
        is a colon.  You cannot add a String key that ends
        with a colon.  If you call remove with a String key
        that ends in a colon, everything that has a key that
        starts with the argument will be removed.

        If your keys are in this format

        TYPE:SOURCE:OBJECT

        And you put n objects in the cache with keys like this

        "ABC:123:0"  to "ABC:123:n"

        then you could remove all the obejcts by calling

        jcs.remove( "ABC:123:" );


Regards,
Simon


-----Original Message-----
From: Tim Cronin [mailto:tcronin@interwoven.com] 
Sent: Tuesday, August 28, 2007 7:01 PM
To: JCS Users List
Subject: Best practice for linking Cache elements

We have a hierarchical structure of cache elements.

Sites contain pages and page contain components so
when we get a cache invalidation for a site we need to
flush all page and component entries for that site.

Our cache key is not a simple string.

I see there is grouping but comments in the code
say that this is going away. 



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


This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this message in error please delete it and any files transmitted with it, after notifying postmaster@uk.mizuho-sc.com 
Any opinions expressed in this message may be those of the author and not necessarily those of the company. The company accepts no responsibility for the accuracy or completeness of any information contained herein. This message is not intended to create legal relations between the company and the recipient. 
Recipients should please note that messages sent via the Internet may be intercepted and that caution should therefore be exercised before dispatching to the company any confidential or sensitive information. 
Mizuho International plc Bracken House, One Friday Street, London EC4M 9JA. TEL. 020 72361090. Wholly owned subsidiary of Mizuho Securities Co., Ltd. Member of Mizuho Financial Group. Authorised and regulated by the Financial Services Authority. Member of the London Stock Exchange. 

Registered in England No. 1203696. Registered office as above.


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