[infinispan-dev] Hash calculation in DefaultConsistentHash

Jason T. Greene jason.greene at redhat.com
Wed Oct 14 16:40:44 EDT 2009


Alex Kluge wrote:
> Hi,
> 
>   I expect that using the Object hashCode, even within the same
>  VM, will be problematic. Two instances of such a class will not have
>  the same hashCode. Hence using one as a key to insert a value into
>  the cache, then using the other to retrieve the value will not
>  produce the expected results. This is true of pretty much any type
>  of hash table, distributed or not. Your key can not use the Object
>  hashCode method.

Sure, in that case it becomes an object identity table (e.g. 
IdentityHashMap), which is fine for some specific uses.

-- 
Jason T. Greene
JBoss, a division of Red Hat



More information about the infinispan-dev mailing list