[infinispan-dev] ISPN-232 - feedback needed

Brian Stansberry brian.stansberry at redhat.com
Mon May 24 12:30:06 EDT 2010


Thanks, Mircea:

A related use case I need to cover[1] is checking whether an existing 
key still hashes to the local node and if not, where it hashes. This may 
not belong in KeyAffinityService, but I'd like it in some place easily 
accessible to the same caller the creates KeyAffinityService.

Set<Address> getAddressesForKey(K key)

Usage:

Set<Address> addresses = getAddressesForKey(sessionId);
if (!addresses.contains(localAddress)) {
   redirectRequest(addresses);
}

getAddressesForKey() could return a List<Address> but then checking 
whether the local address is OK would require a scan. AIUI there 
ordering in the set of DIST nodes is not meaningful, so a Set should be 
fine.

Re: K getCollocatedKey(K otherKey) please note that for the AS use cases 
I know of where colocation is helpful, the colocated data will be stored 
in separate Cache instances, while the KAS is scoped to a cache. The 
method should still be helpful though, as long as the caches use the 
same underlying CacheManager/Channel. It's up to the caller to check that.

On KeyAffinityServiceFactory, there's the bufferSize param:

     * @param keyBufferSize the number of generated keys per {@link 
org.infinispan.remoting.transport.Address}.

That implies the factory will maintain a buffer of keys for *all* 
addresses, not just the local address. The use cases I'm concerned with, 
the only address for which I want keys is the local one.  Perhaps it 
makes sense to offer a separate param for the local address buffer size?

In a small cluster maintaining some keys in a buffer for irrelevant 
addresses is no big deal, but for large clusters it may waste a fair 
amount of memory.

[1] https://jira.jboss.org/browse/JBAS-7853 plus a similar requirement 
for EJB3 as discussed on https://community.jboss.org/docs/DOC-15052


On 05/24/2010 05:15 AM, Mircea Markus wrote:
> Hi,
>
> I've committed[1] the interfaces for the key-affinity service in ISPN-232.
> Would you mind taking a look and let me know what you think?
>
> Thanks!
> Mircea
>
> [1] http://anonsvn.jboss.org/repos/infinispan/trunk/core/src/main/java/org/infinispan/affinity/
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


-- 
Brian Stansberry
Lead, AS Clustering
JBoss by Red Hat


More information about the infinispan-dev mailing list