[JBoss-dev] [JBossCache] - Re: YACL (Yet Another CacheLoader) question
[EMAIL PROTECTED] wrote : This may be a bug in 1.1, but it is definitely calling the CacheLoader in 1.2: |public Node get(Fqn fqn) throws CacheException { | | MethodCall m=new MethodCall(getNodeMethodLocal, new Object[]{fqn}); | | return (Node)invokeMethod(m); | |} | | The invokeMethod() passes the call through the interceptor chain, one of the interceptors is the CacheLoader. | Can you try with 1.2 (either from CVS head, or wait until mid December) ? | | | Bela I've checked out jboss-head and rebuilt it. Calling the cache loader is now done from the interceptor. However, is calling TreeCache.get(Fqn) supposed to result in a call to CacheLoader.get(Fqn) if the node doesn't exist or the map empty? If invoke is called with the source method GetNodeMethodLocal then load_attributes is NOT set to true. /Erik ps somehthing seems to be screwed with this forum (behaviour-wise). I tried to pm you byt that doesn't work. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3857033#3857033 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3857033 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - Re: YACL (Yet Another CacheLoader) question
[EMAIL PROTECTED] wrote : This may be a bug in 1.1, but it is definitely calling the CacheLoader in 1.2: |public Node get(Fqn fqn) throws CacheException { | | MethodCall m=new MethodCall(getNodeMethodLocal, new Object[]{fqn}); | | return (Node)invokeMethod(m); | |} | | The invokeMethod() passes the call through the interceptor chain, one of the interceptors is the CacheLoader. | Can you try with 1.2 (either from CVS head, or wait until mid December) ? | | | Bela In the code I'm looking (I dl:ed jboss-3.2.7RC1 src) there is no 'getMethodNodeLocal' in TreeCache.java. In 1.2, does the interceptor also do get() rather than just put() (as it did in 1.1)? I don't think I can wait until december. I'll try and dl head and build it myself. /Erik View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856863#3856863 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856863 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - YACL (Yet Another CacheLoader) question
Howdy all, I'm (still) implementing a cache loader and trying to get a feel for how it works. I'm wondering about TreeCache.get(Fqn). It does not seem to call CacheLoader.get(Fqn) (which it should in my opinion). My code: TreeCache cache = new TreeCache(); . . Node node = cache.get(new Fqn(top_node); I trace the excution to TreeCache.findNode() and to this snippet: // try CacheLoader if node is not in cache if(child_node == null cache_loader != null) { try { if(cache_loader.exists(fqn)) { child_node=n.createChild(child_name, tmp_fqn, n, UNINITIALIZED, null); notifyNodeLoaded(tmp_fqn); } } View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856727#3856727 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856727 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - Re: YACL (Yet Another CacheLoader) question
Is there a specific reason why my posting was truncated? Is there something wrong with the forum code? /Erik nine_mirrors wrote : Howdy all, | | I'm (still) implementing a cache loader and trying to get a feel for how it works. | I'm wondering about TreeCache.get(Fqn). It does not seem to call CacheLoader.get(Fqn) (which it should in my opinion). | | My code: | | TreeCache cache = new TreeCache(); | . | . | Node node = cache.get(new Fqn(top_node); | | I trace the excution to TreeCache.findNode() and to this snippet: | | // try CacheLoader if node is not in cache | if(child_node == null cache_loader != null) { | try { |if(cache_loader.exists(fqn)) { | child_node=n.createChild(child_name, tmp_fqn, n, UNINITIALIZED, null); | notifyNodeLoaded(tmp_fqn); |} | } | View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856728#3856728 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856728 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - Re: YACL (Yet Another CacheLoader) question
Since my original posting was truncated, here comes the rest: it executes the n.createChild(...) but never calls the CacheLoader to get the data. Do I misunderstand what the TreeCache.get(Fqn) method is supposed to do (ie fetch the data from 2nd store if not available in the local cache)? I'm rather confused at this point. Also, looking at the TreeCache code it seems like TreeCache.get(Fqn, key) would result in calling CacheLoader.get(Fqn) which means that I could use this method instead. On the other hand this only increases my confusion. Grateful for any help Erik Svensson View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856729#3856729 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856729 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - Possible newbie question but still a problem
Howdy all! background: In our db we have a rather large table (500k entries). Said table is growing over time but not all entries are live. We are aware of this so we prune the table about once a week. The only live entries that we are sure of at run-time are those that are actually requested by the client systems. What I want to do is to cache only the requested entries. I do not want to lift the entire table into the cache. I therefore implemented a rudimentary cache loader and when my test app calls get(Fqn,Key) I expected the CacheLoader.get(Fqn,Key) to called. Instead get(Fqn) is called. I return an empty hash map since I can't tell what actual entry that is reqeusted. The actual call sequence seems to be: TreeCache.get(Fqn,Key) CacheLoader.exists(Fqn) (I return true) CacheLoader.get(Fqn) (return an empty hash map) And then TreeCache.get(Fqn,Key) returns null. I've been fippling with the various options in the config file to no avail and now I'm at my wits end. I'm grateful for any help. cheers Erik The relevant entries in the config file: false false false com.ongame.naps.cache.NapsCacheLoader My code: public class Cache { public Cache(){ . . . fCache = new TreeCache(); PropertyConfigurator pc = new PropertyConfigurator(); pc.configure(fCache,conf_file); // the cache loader is set in the config file fCache.setFetchStateOnStartup(false); fCache.create(); fCache.startService(); . . } public Entry get(Fqn domain,long key){ . . Entry entry = fCache.get(domain, new Long(key)); . } } View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856057#3856057 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856057 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - Re: Possible newbie question but still a problem
norbert wrote : You are right, as of JBossCache 1.1 get(Fqn,Key) is actually only being called by the JUnit-testcases. In respect to TreeCache itself it's (yet) redundant. | | Instead of returning null your CacheLoader should return a prefilled Map of Key-Value-pairs when get(Fqn) is being called | This is exactly NOT what I want to do. The table is way too large for being moved from the db to the cache and the individual entries are not guaranteed to be live either, which means that we would move unneccessary data from the db to the cache. Since the whole point is to cut down on the db accesses this does not make sense. Also, if data is added to the db then I would have to get the whole table again everytime I get a cache miss. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856063#3856063 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856063 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBossCache] - Re: Possible newbie question but still a problem
norbert wrote : It's absolutely unefficient to store a whole table in a single node - Transactional locking, eviction and Cacheloading work on Node-level, not key/value-pair level. As a result every 'put(Fqn,key,value)' would lock your entire data if the Fqn being used is a constant. | | You are better of if you map the primary-keys of your table to different Fqn's (respectivly nodes in the tree) and the values from the rows of your table to the attributes stored in the node. | | This way access to a node will load a single row from the db. | The database is at least 500k entries. At least 70% is live. Imagine what that will do to the node hiearchy. Also, in my view, it seems inefficient to me to store just one value in each hashmap. I don't find one node per row to be an attractive solution. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3856071#3856071 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3856071 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development