Re: Custom Java Objects as Key in IgniteCache with persistence enabled

classic Classic list List threaded Threaded
2 messages Options
Mitchell Rathbun (BLOOMBERG/ 731 LEX) Mitchell Rathbun (BLOOMBERG/ 731 LEX)
Reply | Threaded
Open this post in threaded view
|

Re: Custom Java Objects as Key in IgniteCache with persistence enabled

Sorry for the delayed response, I have not since been able to reproduce this. In general how does key equality work with Ignite, given that the keys in the cache must be serialized? Does equals/hashCode even come into play?

From: [hidden email] At: 12/19/19 04:27:04
To: [hidden email]
Subject: Re: Custom Java Objects as Key in IgniteCache with persistence enabled

Hi, Mitchell!

I can't reproduce your case, i.e. key objects are put correctly in my case.
Could you send a link to your code, for example on github?

Here is my attempt to reproduce:
https://github.com/shishkovilja/ignite/blob/d35ec9ee05f61692f1e3301ca3258fbe86f9
b4f7/modules/core/src/test/java/org/apache/ignite/userlist/CustomObjectTest.java




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

ezhuravlev ezhuravlev
Reply | Threaded
Open this post in threaded view
|

Re: Custom Java Objects as Key in IgniteCache with persistence enabled

Hi,

No, equals/hashCode from Objects are not used by Ignite. For example, to calculate hashCode for the object, Ignite uses BinaryArrayIdentityResolver which calculates hashCode from serialized object. As for key equity - it compares serialised forms of the objects.

Best Regards,
Evgenii

пн, 30 дек. 2019 г. в 09:22, Mitchell Rathbun (BLOOMBERG/ 731 LEX) <[hidden email]>:
Sorry for the delayed response, I have not since been able to reproduce this. In general how does key equality work with Ignite, given that the keys in the cache must be serialized? Does equals/hashCode even come into play?

From: [hidden email] At: 12/19/19 04:27:04
To: [hidden email]
Subject: Re: Custom Java Objects as Key in IgniteCache with persistence enabled

Hi, Mitchell!

I can't reproduce your case, i.e. key objects are put correctly in my case.
Could you send a link to your code, for example on github?

Here is my attempt to reproduce:
https://github.com/shishkovilja/ignite/blob/d35ec9ee05f61692f1e3301ca3258fbe86f9
b4f7/modules/core/src/test/java/org/apache/ignite/userlist/CustomObjectTest.java




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/