[jboss-jira] [JBoss JIRA] Created: (JBCACHE-1368) Change the CacheLoader.putAll() method to replace not append

Elias Ross (JIRA) jira-events at lists.jboss.org
Fri Jun 13 02:13:33 EDT 2008


Change the CacheLoader.putAll() method to replace not append
------------------------------------------------------------

                 Key: JBCACHE-1368
                 URL: http://jira.jboss.com/jira/browse/JBCACHE-1368
             Project: JBoss Cache
          Issue Type: Task
      Security Level: Public (Everyone can see)
            Reporter: Elias Ross
         Assigned To: Manik Surtani
             Fix For: 3.0.0


Almost all CacheLoader implementations do a read of the existing data map when "putAll" is called but this may be unnecessary as the Cache likely has loaded the cache loader data at some point.

Manik suggests: "[We] need to analyse in the interceptors and see if that can be done away with. No real reason to do a read here. From the cache loader javadoc for the put(Fqn, Map) method: 
  'Puts all entries of the map into the existing map of the given node, overwriting existing keys, but not clearing the existing map before insertion. '
"

One improvement would be to check in the CacheLoader impl. if the Node was already loaded, then the Map merge can happen without the read. However, this logic might better belong in the cache loader interceptor. It might work okay to do this check in the base class for existing CacheLoader impl. as well.

Relates all JBCACHE-1221 - JDBC cache loader optimization.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list