[infinispan-dev] [ISPN-548] Discussion on updating the QueryInterceptor to be able to update old keys

Mircea Markus mircea.markus at jboss.com
Wed Jul 21 09:04:11 EDT 2010


On 21 Jul 2010, at 12:54, Navin Surtani wrote:

> Just getting a discussion going on this since a JIRA has now been created.
> 
> Basically, the way I see it is that we can check which keys in the cache 
> have already been used - but that's context specific (I'll probably need 
> a quick explanation to how the InvocationContexts work). The question 
> for the gurus of ISPN here is whether or not this is going to be an issue.
> 
> The plan of attack is as follows: -
> 
> 1 - User does a put()
> 2 - Interceptor checks the set of keys used within the same context to 
> see if the same key has been used
That can be achieved through: 
CacheEntry cacheEntry = ctx.lookupEntry(command.getKey());
The CacheEntry corresponds to a (key,value) pair in the cache.
Now, you can check the following:
1. (key,value) has been newly added?
cacheEntry.isCreated()
2. or is it just updated?
cacheEntry.isChanged()
> 3 - If it has an UPDATE is used.
> 4 - If not we do an ADD.
> 
> Reckon that sounds okay?
> 
> -- 
> Navin Surtani
> Intern Infinispan
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
HTH,
Mircea


More information about the infinispan-dev mailing list