map loader and read-through predicate query

298 views
Skip to first unread message

Christian Bourque

unread,
Mar 8, 2012, 12:32:58 PM3/8/12
to haze...@googlegroups.com
Hi,

I was wondering how hard it would be to implement this feature: currently Hazelcast supports read-through for simple get(key) on a map, that is if the key is not already cached it will delegate the call to the map loader implementation load(key).

But for a predicate query it only works on the already cached entries (the query is not delegated to the map loader if nothing is found in the cache).

It would be neat if Hazelcast could support something like loadKeys(predicate) in the map loader interface. This way if no result are returned from the cache the query could be delegated to the map loader and then the database (or something else)!

I know I could use loadAllKeys() but the problem is that we have huge tables that would take a considerable amount of time to preload in the cache and it doesn't make sense in our case...

Thanks

Christian

Ferran Maylinch

unread,
Jun 27, 2013, 11:34:25 AM6/27/13
to haze...@googlegroups.com
Hi Christian,

Today we were thinking about that too, and we thought that it has no sense because searches by predicate would always need a query to the underlying store (database or whatever) since Hazelcast never knows if the map contains everything or not.

That makes me wonder what's the purpose of predicates in Hazelcast if you can only search what you already have in the map.

Enes Akar

unread,
Jun 28, 2013, 9:10:41 AM6/28/13
to haze...@googlegroups.com
It is easy to load from map-store when nothing is found in map on query.
The hard thing is that what we will do when map gives records. Maybe more records exist in datastore but evicted from map. Should I query all records from datastore at each map query? If yes then why I do query on map, datastore query will be enough. 



--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.

To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Enes Akar
Hazelcast | Open source in-memory data grid
Mobile: +90.505.394.1668

Christian

unread,
Jun 28, 2013, 11:25:32 AM6/28/13
to haze...@googlegroups.com
You're missing the point!

Have a look at Oracle TimesTen or VMware GemFire and you'll understand what I was talking about!
Reply all
Reply to author
Forward
0 new messages