[infinispan-dev] A mechanism for users to control data localitywhen using DIST

Manik Surtani manik at jboss.org
Tue Mar 23 16:23:21 EDT 2010


On 23 Mar 2010, at 18:53, Bryan Grunow wrote:

> “put(K, V) is overloaded with put(K, V, String group)”
>  
> Instead of using a String could this be changed to Object?  We’ve tested this feature in the past with other systems and typically for us our “group” is not a String.  Yes, we could convert our objects to Strings but I’m not sure I see the point if this could just be an Object.

Fair point, it doesn't have to be a String.


>  Also, I’m not sure why annotations wouldn’t work if the annotation is for the method to invoke to get the group and not statically defining a group.  Other systems I’ve used employ this technique. 
>  
> Annotations are fine as an option (if they work for this case) but as with my post in the user forum if you were to go this route I’d like it if there were an option of defining this as in a configuration file as well to not put constraints on the object model we create.

Again, annotations or a "producer" method could be additional ways to do this, but none of these remove the need for being able to do so on the API as above.  And if it is on the API, then is there any real value in allowing annotations/producer methods?

>  
> Bryan
>  
> From: infinispan-dev-bounces at lists.jboss.org [mailto:infinispan-dev-bounces at lists.jboss.org] On Behalf Of Manik Surtani
> Sent: Monday, March 22, 2010 9:45 AM
> To: infinispan -Dev List
> Subject: [infinispan-dev] A mechanism for users to control data localitywhen using DIST
>  
> So there have been some requests for this ability [1], and although I did blog about some strategies to achieve this [2], one of which Brian plans to employ for HTTP session state in JBoss AS 6, I think this is something generally useful and a simpler "user" solution should be offered.   Annotations won't work for a number of reasons (mainly because this affinity information should be associated with a key instance, not a key class).  So here is what I propose, from an API perspective:
> 
> put(K, V) is overloaded with put(K, V, String group).  "group" is an arbitrary, user-defined string, and it is up to the API user to ensure these are unique, and related entries are properly grouped.
> 
> Note that this is similar in some ways to another JIRA proposed by Mindaugas Žakšauskas some months ago: ISPN-312 [3].
> 
> In terms of implementation, I expect we could add a DataAffinityInterceptor which would:
> 
> * for puts, instead of putting (K, V) in the cache, it would put (group, AtomicMap) and (K, group) in the cache, and (K, V) in the AtomicMap.  Similar behaviour for other writes.
> * for gets, instead of retrieving (K), from the cache, it would retrieve K to get the group id, and then retrieve the atomic map related to the group before retrieving the key.
> 
> The effect of this is to hide the complexities of interacting with AtomicMaps from users by providing a convenience API.
> 
> What do people think?
> 
> Cheers
> Manik
> 
> [1] https://jira.jboss.org/jira/browse/ISPN-359
> [2] http://infinispan.blogspot.com/2009/08/distribution-instead-of-buddy.html
> [3] https://jira.jboss.org/jira/browse/ISPN-312
> 
> --
> Manik Surtani
> manik at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
>  
> 
> 
>  
> --------------------------------------------------------------------- 
> This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful. _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20100323/39166e14/attachment-0002.html 


More information about the infinispan-dev mailing list