[infinispan-dev] storeAsBinary: serialize keys, values, or both?

Manik Surtani manik at jboss.org
Thu May 12 12:13:23 EDT 2011


The hashcode is the same either way:

https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/marshall/MarshalledValue.java#L193


On 12 May 2011, at 16:59, Sanne Grinovero wrote:

> thank you.
> Not very critical for functionality, but now I'm wondering if the
> consistent hash is being calculated on the binary form of the key?
> Just curious if we might end up with inconsistent definitions of
> "owner" in case it's possible to have the hash function invoked at
> different points of the key's lifecycle (i.e. if at some point it's
> calculated on the object form, and in other points of the code it's
> calculated on byte[], then something would break).
> 
> Especially, if I where to write any custom extension needing to know
> the owner of a specific key, if I have to apply some considerations.
> 
> Sanne
> 
> 2011/5/12 Manik Surtani <manik at jboss.org>:
>> 
>> On 12 May 2011, at 16:06, Manik Surtani wrote:
>> 
>> On 11 May 2011, at 18:27, Sanne Grinovero wrote:
>> 
>> I'm also wondering how the equals is performed on a serialized key; I
>> assume they are compared as byte[], but if that's the case that should
>> be clearly documented as it would ignore any custom equals()
>> implementation.
>> 
>> Your assumption is correct:
>> https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/marshall/MarshalledValue.java#L176
>> Good point that it needs to be documented clearly.  Doing it now.
>> 
>> Done:
>> http://community.jboss.org/wiki/Marshalling#Equality_Considerations
>> --
>> Manik Surtani
>> manik at jboss.org
>> twitter.com/maniksurtani
>> Lead, Infinispan
>> http://www.infinispan.org
>> 
>> 
>> 
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20110512/4532ca53/attachment.html 


More information about the infinispan-dev mailing list