Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 25333 invoked from network); 14 May 2008 21:21:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 May 2008 21:21:33 -0000 Received: (qmail 90773 invoked by uid 500); 14 May 2008 21:21:35 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 90212 invoked by uid 500); 14 May 2008 21:21:33 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 90201 invoked by uid 99); 14 May 2008 21:21:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2008 14:21:33 -0700 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=FB_MORE_SIZE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xasima@gmail.com designates 209.85.128.190 as permitted sender) Received: from [209.85.128.190] (HELO fk-out-0910.google.com) (209.85.128.190) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2008 21:20:44 +0000 Received: by fk-out-0910.google.com with SMTP id e30so101972fke.3 for ; Wed, 14 May 2008 14:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=JteYBjinSzBZm2fKH4yB5MntLdQYCnwDxagFH+EEVRk=; b=Xg3IlcOjmgCMKC1EUPXbR3MjiJOXcsPbxXIJenCXGNZ2GTKgF7gqqy32kieXdKhKxLlgqx2Kl5PYAAnZqmxin6s23h83afhktn+r4VCeypa0s4NceJzwKHNG/e8Dk5NQrfIRqmL6V6nGNJDkCXmYC+QBUAxvveUktVYQU7+zqmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=WxvLLcBB443vWNxSNe0WeEorsbyfwr796QttCIrf04r4HSwQriE0tbjcObLmNQ6YuAkS1YsWTMEx8o2kKGPYg8XARBTV4rEnaQ+IzX8GkETcUfSTCIs3Y5Z4xrkc2PhyZnTqt87Kj/LncACkMxcDhlHFZgJkVllrKjP6uad2wNk= Received: by 10.142.126.17 with SMTP id y17mr619822wfc.170.1210800055864; Wed, 14 May 2008 14:20:55 -0700 (PDT) Received: by 10.142.215.3 with HTTP; Wed, 14 May 2008 14:20:54 -0700 (PDT) Message-ID: <7d6453040805141420u2ae4e816w59e93364f704445@mail.gmail.com> Date: Thu, 15 May 2008 00:20:54 +0300 From: "Xasima Xirohata" To: user@geronimo.apache.org Subject: Re: POJO caching in geronimo Cc: gianny.damour@optusnet.com.au In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1835_8200825.1210800055873" References: <7d6453040804300922p369af3b3w64046ff4b24ea9fe@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1835_8200825.1210800055873 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, Gianny Damour and team. I want to list my questions and proposals to the possible architecture and features of the Geronimo POJO cache that WADI is going to implement soon. Assume that we are exposing a POJO cache using GBean, so POJOCache is available through JNDI (new InitialContext().lookup("java:comp/env/cache"))if gbean-ref and dependencies is included into Geronimo specific deployment plan. The following questions are interesting for me. 1) I wonder what interfaces need to be exposed to access this POJO Cache. We need to list these interfaces in "implements =85" block when declaring GBEAN and in gbean-ref / ref-type section. And developers will us= e the pojo cache using these (this) interface as well. I suspect that we need at least the following interfaces: JSR-107 JCache related interfaces, plain java.util.Map, and the specific implementation (ehcache, jcs) if someone needs to use that implementation directly. First of all I want to consider JCache. JCache standard is far from being a final and it is changing till now. Here is the list of limitation of the current JSR standard http://ehcache.sourceforge.net/documentation/jsr107.html (see section "Problem and limitation"), so these limitations need to be worked around or just emphasized for the developer if we decided to expose JCache as the primary interface over geronimo pojo cache gbean. The next question is on plain java.util.Map interface. In theory JCache (JCache.CacheMap) implements Map, so one may do the cast "(Map) jcache" if (s)he prefers plain Map over instantiating JCache or just uses Map in code already. However http://shevek.livejournal.com/84313.html complains on a slight incompatibility with the expected usage of Map, so our pojo gbean might play as wrapper to resolve this incompatibility as well. The last issue on getting underline implementation can probably be easily solved with gettingBackingCache() method from JCache, although it quite interesting to figure out (from configuration or JMX) which implementation is tired with now. 2) The next question is on the number of GBean, that related to the maintenance of pojo caching. Is the PojoCache gbean needs to be the only gbean related to the cache, or (in distributed case) it may act as wrapper to the actual ehcache/tabgosol/terracotta/wadi/jboss-cache-wrapper gbeans. In the later case we just need to raise up the target gbean and provide al= l configuration to it, and later just wired the actual GBEAN with the remote (external) one. This may probably help to monitor and configure these cache= s in more subtle way and allow to remain everything in the target application the same (even a Geronimo-deployment descriptors), while just plug-in (hot-replace) any remote / distributed / multilayered caching solution even in runtime. Example, you just set up the application (war/ear) that have th= e only dependency o local POJO cache gbean, that is used fast JCS back end while no other authentificated plug-in discovering request occurs, but when this happens your caching solution becomes multi tired (hierarchical) with very light 1level local cache with specific expiration policy and 2level distributed (memcache-d aware) cache. 3) The third question is on Statistic. We have some pretty tab on the JMX section in Geronimo that seems to be used as viewer some graphics on historical data. Really I don't know how to exposed some data from the Gbea= n to there, but it seems to be nice to have exposed such a parameters as number of hits per second, or the pluggable one statistic like "how many request in percent to the total are done to the specific part of our cached data" or "how many data are stored in the disk sue to short overflow of overall memory restriction for the given local cache" (when storing is switch on). The result of such a statistic is useful for capacity planning and tuning the system. It's interesting not only to plug such a statistic and get this from regula= r Geronimo JMX tabs, but do this easily with no binding to the specific underline implementation. I suppose that this may be done if we just wrap any put / get methods of POJO GBean implements JCache with some JAMON (*). Concrete interceptors (what collect in very specific cases) may be tired up with GBean using AOP (**). Probably we need to integrate native JMX support for such a project as well (***) So we have three questions here: how to expose such a data to JMX statistic tab, how to add user defined interceptors, and how to configure (switch off such a tools on production when deploy or in runtime by JMX value) 4) The next question is where to locate specific configuration files like ehcache.xml. The more precise question is where it is possible and appropriate to locate such a files. I suppose that local cache parameters (1level local cache gbean) may be located in war/ear, and the parameters fo= r regular distributed cache (2level distributed cache gbean) needs to be located in config.xml + var/config 5) The last issue is to provide compact maven build and maven subproject to easily install specific cache bundle (with no 70 mb of terracota, the WHOLE wadi or something else) 6) What do we need to get reasonable from http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs/2= .2.0.BETA1/userguide_en/html_single/index.htmlor Glassfish cashing? (*) www.jamonapi.com (**)http://www.ibm.com/developerworks/java/library/j-aopwork10/ (***)http://wiki.burnayev.com/page/JMX+Monitoring+of+Ehcache?t=3Danon What do you think on this? On Thu, May 1, 2008 at 6:22 AM, Gianny Damour wrote: > Hello Xasima, > > WADI does not yet provide a POJO caching solution. > > Regarding the http://incubator.apache.org/wadi/wadi-core/apidocs/org/code= haus/wadi/gridstate/impl/GCache.html > class, AFAIK it was more an idea than an actual fully working caching > implementation. > > I know that a Geronimo POJO caching solution, GCache, was implemented a > while back in the geronimo-sandbox and documented here http:// > cwiki.apache.org/GMOxDEV/geronimo-clustering-with-gcache.html. However, a= s > this caching solution has not been touched for a while, I do not think it= is > in a working state. > > The approach you are taking seems to me reasonable and I think it would b= e > quite useful for other users to have such GBean services for JCS or EHCac= he. > > FYI, I am currently working on the implementation of a hierarchical, > transactional, distributed, partitioned and replicated cache and data-gri= d > solution as part of WADI. I hope to have a working solution at the end of > the month and hopefully before you having the need for it :) > > Thanks, > Gianny > > > On 01/05/2008, at 2:22 AM, Xasima Xirohata wrote: > > Hi. I want to figure out what is the proper strategy to plug-in POJO cac= he >> into geronimo (2.1). >> I want to use the different implementation of caching (HashMap, EHCACHE= , >> JCS) and work in standalone mode (not explicit clustering support for t= he >> first time). >> >> In the existed code we just want to get a cache instance using JNDI, cas= t >> this to java.util.Map and invoke plain put/get methods. >> I have explored geronimo docs and found the following possibilities: >> 1) use the terracotta (http://www.terracotta.org/confluence/display/o= rgsite/Distributed+Caches) >> that exposes such an wrapper around different implementation. >> 2) use the wadi and the http://incubator.apache.org/wadi/wadi-core/ap= idocs/org/codehaus/wadi/gridstate/impl/GCache.html >> class somehow >> 3) use the custom gbean as wrapper upon different implementation of >> caching (as the general solution for any separate custom services). >> >> Unfortunately, the 70Mb size of Terracotta seems too heavy to use for su= ch >> a use case when I don't plan to work with clustering at once. >> I don't found a page to integrate this options with WADI, please provide >> some details on this.. >> So I have stopped with the last way. I think that having POJO cache >> exposed as gbean (instead of using as regular embedded jar) is a right >> strategy since it is quite naturally to >> 1) implement initializing, clearing, storing (if persistence is on) o= f >> POJO cache when the correspondent geronimo lifecycle events occur >> 2) providing different in the gbean plan to >> configure in external manner different POJO cache parameters >> 3) having MBean that reports on state and loads of the cache ( it may >> be interesting how much objects are consumes from this and if we need t= o >> change expiration policy or allocate more size) >> >> Am I right with the approach? Do you have any predefined gbeans (or >> prototype in sandbox code area) code for this? >> Could I use WADI for this purpose? >> -- >> Best regards, >> ~ Xasima Xirohata ~ >> > > --=20 Best regards, ~ Xasima Xirohata ~ ------=_Part_1835_8200825.1210800055873 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

Hello, Gianny Damou= r and team. I want to list m= y questions and proposals to the possible architecture and features of the Geronimo POJO cache that WADI is going to implement soon.

Assume that we are exposing a P= OJO cache using GBean, so POJOCache is available through JNDI (new InitialContext().lookup("java:comp/env/cache")) if gbean= -ref and dependencies is included into Geronimo specific deployment plan.  The following questions are interesting for me.

= 1)   = ;  I wonder what interfaces need to be exposed to access this POJO Cache. We nee= d to list these interfaces in "implements =85" block when declaring GBEAN and in gbean-ref / ref-type section. And developers will use the pojo cache using these (this) interface as well.

I suspect that we need at least the following interfaces:
JSR-107 JCache related interfa= ces, plain java.util.Map, and the specific implementation (ehcache, jcs) if some= one needs to use that implementation directly.

First of all I want to consider JCache. JCache standard is far from being a final and it is changing till now.  Here is the list of limitation of the current JSR standard http://ehcache.sourceforge.= net/documentation/jsr107.html (see section "Problem and limitation"), so these limitations need to be wor= ked around or just emphasized for the developer if we decided to expose JCache = as the primary interface over geronimo pojo cache gbean.

The next question is on plain java.util.Map interface. In theory JCache (JC= ache.CacheMap) implements Map, so one may do the cast "(Map) jcache" if (s)he prefers plai= n Map over instantiating JCache or just uses Map in  code already.  However http://shevek.livejournal.com/84313.ht= ml complains on a slight incompatibility with the expected usage of Map, so  
our pojo gbean might  play as wrapper to resolve this incompatibility as well.

The last issue on getting underline implementation can probably be easily solved with gettingBackingCache() method from JCache, although it quite interesting to figure out (from configuration or JMX) which implementation = is tired with now.

2)&= nbsp;    The next question is on the number of GBean, that related to the maintenance of pojo caching. Is the PojoCache gbean needs to be the only gbean related to the cache, or (in distributed c= ase) it may act as wrapper to the actual ehcache/tabgosol/terracotta/wadi/jboss-cache-wrapper gbeans. In the later c= ase we just need to raise up the target  gbean and provide all configuration to it, and later just wired the actual GBEAN with the remote (external) one. This may probably help to moni= tor and configure these caches in more subtle way and allow to remain everythin= g in the target application the same (even a Geronimo-deployment descriptors), w= hile just plug-in (hot-replace) any remote / distributed / multilayered caching solution even in runtime. Example, you just set up the application (war/ear= ) that have the only dependency o local POJO cache gbean, that is used fast J= CS back end while no other authentificated plug-in discovering request occurs,= but when this happens your caching solution becomes multi tired (hierarchical) = with very light 1level local cache with specific expiration policy and 2level distributed (memcache-d aware) cache.

3)&= nbsp;    The third question is on Statistic. We have some pretty tab on the JMX section in Geronimo that seem= s to be used as viewer some graphics on historical data. Really I don't know how= to exposed some data from the Gbean to there, but it seems to be nice to have exposed such a parameters as number of hits per second, or the pluggable on= e statistic like "how many request in percent to the total are done to the specific part of our cached data" or "how many data are stored in the disk = sue to short overflow of overall memory restriction for the given local cache" (when storing is switch on). The result of such a statistic is useful for capacity planning and tuning the system.

It's interesting not only to plug such a statistic and get this from regula= r Geronimo JMX tabs, but do this easily with no binding to the specific under= line implementation. I suppose that this may be done if we just wrap any put / g= et methods of POJO GBean implements JCache with some JAMON&nb= sp; (*). Concrete interceptors (what collect in very specific cases) may be tired up  with GBean using AOP (**). Probably we need to integrate native JMX support for  such a project as well (***)

So we have three questions here: how to expose such a data to JMX statistic tab, how to add user defined interceptors, and how to configure (switch off such a tools on production when deploy or in runtime by JMX value)

= 4)<= span style=3D"font-family: "Times New Roman"; font-style: normal;= font-variant: normal; font-weight: normal; font-size: 7pt; line-height: no= rmal; font-size-adjust: none; font-stretch: normal;">   &nbs= p; The next question is where to locate specific configuration files like ehcache.= xml. The more precise question is where it is possible and appropriate to locate such a files. I suppose that local cache parameters (1level local cache gbe= an) may be located in war/ear, and the parameters for regular distributed cache (2level distributed cache gbean) needs to be located in config.xml  + var/config

= 5)<= span style=3D"font-family: "Times New Roman"; font-style: normal;= font-variant: normal; font-weight: normal; font-size: 7pt; line-height: no= rmal; font-size-adjust: none; font-stretch: normal;">   &nbs= p; The last issue is to provide compact maven build  and maven subproject to = easily install specific cache bundle (with no 70 mb of terracota, the WHOLE wadi o= r something else)

6) What do we  need to get reasonable  from http://www.jboss.org/file-acc= ess/default/members/jbosscache/freezone/docs/2.2.0.BETA1/userguide_en/html_= single/index.html or Glassfish cashing?

 

 
(*) www.jamonapi.com

(**)http://www.ibm.com/d= eveloperworks/java/library/j-aopwork10/

(***)http://wiki.bu= rnayev.com/page/JMX+Monitoring+of+Ehcache?t=3Danon

 

&nbs= p;What do you think on this?

     =



On Thu, May 1, 2008 at 6:22 AM, Gianny D= amour <gianny.damour@op= tusnet.com.au> wrote:
Hello Xasima,

WADI does not yet provide a POJO caching solution.

Regarding the http://incubator.apache.org/wadi/wadi-core/apidocs= /org/codehaus/wadi/gridstate/impl/GCache.html class, AFAIK it was more = an idea than an actual fully working caching implementation.

I know that a Geronimo POJO caching solution, GCache, was implemented a whi= le back in the geronimo-sandbox and documented here http://cwiki.apache.org/GMOxDEV/geronimo-clustering-with-gcache.html. = However, as this caching solution has not been touched for a while, I do no= t think it is in a working state.

The approach you are taking seems to me reasonable and I think it would be = quite useful for other users to have such GBean services for JCS or EHCache= .

FYI, I am currently working on the implementation of a hierarchical, transa= ctional, distributed, partitioned and replicated cache and data-grid soluti= on as part of WADI. I hope to have a working solution at the end of the mon= th and hopefully before you having the need for it :)

Thanks,
Gianny


On 01/05/2008, at 2:22 AM, Xasima Xirohata wrote:

Hi. I want to figure out what is the proper strategy to plug-in POJO cache = into geronimo (2.1).
I want to use the different implementation of caching (HashMap,  EHCAC= HE, JCS) and work in standalone mode  (not explicit clustering support= for the first time).

In the existed code we just want to get a cache instance using JNDI, cast t= his to java.util.Map and  invoke plain put/get methods.
I have explored geronimo docs and found the following possibilities:
   1) use the terracotta (http://www.terracotta.org/confluence/disp= lay/orgsite/Distributed+Caches) that exposes such an wrapper around differe= nt implementation.
   2) use the wadi and the http://incubator.apache.org/wadi/wadi-c= ore/apidocs/org/codehaus/wadi/gridstate/impl/GCache.html class somehow
   3) use the custom gbean as wrapper upon different implementat= ion of caching (as the general solution for any separate custom services).<= br>
Unfortunately, the 70Mb size of Terracotta seems too heavy to use for such = a use case when I don't plan to work with clustering at once.
I don't found a page to integrate this options with WADI, please provid= e some details on this..
So I have stopped with the last way. I think that having POJO cache exposed= as gbean (instead of using as regular embedded jar) is a right strategy si= nce it is quite naturally to
   1) implement initializing, clearing, storing (if persistence = is on) of POJO cache when the correspondent geronimo lifecycle events occur=
   2) providing different <attribute > </attribute> = in the gbean plan to configure in external manner different  POJO cach= e parameters
   3) having MBean that reports on state and loads of the cache = ( it may be interesting how  much objects are consumes from this and i= f we need to change expiration policy or allocate more size)

Am I right with the approach? Do you have any predefined gbeans (or prototy= pe in sandbox code area) code for this?
Could I use WADI for this purpose?
--
Best regards,
~ Xasima Xirohata ~




--
Best regard= s,
~ Xasima Xirohata ~ ------=_Part_1835_8200825.1210800055873--