--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hazelcast/-/BPPNKFIB1b8J.
To post to this group, send email to haze...@googlegroups.com.
To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
I'm not sure I understand well what you mean by "tenuous connection".
Are you denying that byte arrays are an important? In my opinion, it
should be supported natively. Raw data should not need to be wrapped
and unwrapped unnecessarily.
I'm suggesting a simple thing: in the map implementation there should
just be one more if type check. If value is a byte array (or any
primitive array by that matter), then calculate hashcode using
java.util.Arrays.hashCode. Is that a big deal?
And also, if it's a byte[], can't serialization be omitted all together?
Creating the wrapper is indeed very simple, that is not the problem,
but rather it's an annoying indirection. Forking is not an option,
because I planing to use in another library, and I don't want it to
depend on a soon outdated fork.
I don't see a solid argument against making such a trivial change for
better supporting a fundamental datatype.
I am a fan of always using the serialized form for equals and hashCode. It's consistent, and more performant because it can reduce the amount of deserialization operations needed to run comparisons.
Tim, you state that it doesn't make sense to compare references in a distributed system, but then say it should function like Java Maps. You can't have both. While this behavior isn't surprising to someone using IMap like a plain old java Map, it is surprising to those who've read the hazelcast documentation O.o
remove(key, value) : "This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class."
-.- le sigh
So far in the few months I have been on this list, this has bitten 4 people including myself. Either fix the docs, or fix the code.
Docs here is not wrong,
remove(key, value) : "This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class."
That expression is about key, not the value. And before in this thread what I said was also the same ;
"Hazelcast always uses serialized (binary) form's hashCode and equals for keys. But operations rely on value argument – such as remove(key, value), containsEntry(key, value), replace(key, oldValue, newValue) – use hashCode and equals implementations of value."
@mmdogan
~ Sent from mobile
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hazelcast/-/c7V9J_7wIzYJ.
remove(key, value) : "This method uses hashCode and equals of binary form of the key, not the actual implementations of hashCode and equals defined in key's class."
So far in the few months I have been on this list, this has bitten 4 people including myself. Either fix the docs, or fix the code.