Avoids null values from MapLoader.load(Key)

100 views
Skip to first unread message

ramki

unread,
Jul 13, 2011, 7:33:46 PM7/13/11
to Hazelcast
Hello,

I have implemented a custom MapLoader. But, on cache miss, when load()
is called, say I cannot come up with the data with my own logic, then
I don't want the null value to go into the Map for that key. is there
any way to avoid this?

Thanks,
Ram

Fuad Malikov

unread,
Jul 14, 2011, 5:41:21 AM7/14/11
to haze...@googlegroups.com
Not right now, There is couple of issues already filed for this (566 & 578).
The reason we put null value into map is not to check the loader again with the same key. But yes, this should be transparent to the user.

Fuad


--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
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.




--
Fuad Malikov
+90.538.378.9777
http://twitter.com/fuadm


ramki

unread,
Jul 14, 2011, 9:21:50 AM7/14/11
to Hazelcast
do you have any solution with existing hazelcast features? or is it up
to the the user to detect that and remove it?

Timothy Peierls

unread,
Jul 14, 2011, 11:36:25 AM7/14/11
to haze...@googlegroups.com
I'm coping with this by inverting the relationship and not using the MapLoader/MapStore functionality, instead writing Map (or Map-like) abstractions on top of a persistent store -- JClouds BlobStore, in my case -- with caching provided by Hazelcast IMaps. I store a sentinel value to represent the absence of a value in the persistent store.

This posting describes how that approach could be used in fixing MapLoader/MapStore:


--tim

ramki

unread,
Jul 15, 2011, 11:02:59 AM7/15/11
to Hazelcast
Thanks Tim, will check it out.
Reply all
Reply to author
Forward
0 new messages