-
1. Re: CacheLoader.get(Fqn name) return a view?
manik Apr 1, 2006 5:41 AM (in response to genman)This depends on how people use maps in nodes, but in general I believe that the Map of a Node should be loaded and unloaded atomically. Simply because if we do try partial loading of this map, we will never know if the map is completely loaded (to perform operations such as getKeys() or numAttribs()) without maintaining a separate flag of sorts to tell us about partially loaded maps.
I'm not saying it is a bad idea - on the contrary, lazy loading the contents of a node can only be a good thing. My only concern is that there will be a complexity and overhead penalty for doing this, and is this penalty worthwhile considering common use cases? -
2. Re: CacheLoader.get(Fqn name) return a view?
genman Apr 2, 2006 6:20 PM (in response to genman)
Okay, I settled on returning a simple HashMap from the "get" operation. I'll rely on the fact that JBossCache won't call "get" for every key separately. I was very confused by the performance test which seemed to repeatedly do:CacheLoader.get(Fqn name).get(Object key)
which isn't a very "fair" test, IMHO.
Although I'm not going to write it as a "view", I decided to keep the keys as discrete entries, though. It doesn't seem to be a performance issue and can only improve cases where there are thousands of keys being changed or removed for a Fqn.