Reputation: 505
I would like to know do I need to have the mapstore implementation across all the hazelcast servers or only 1 is enough?
for example, I have 4 hazelcast servers. if I set the same mapstore in all 4 servers does this means all 4 hazelcast servers will execute the same logic 4 times for the same key? (There is no clear documentation mention this ).
Another case, if I call imap.put(k,v), will all 4 hazelcast servers call the load(key) method at the same time or only 1 server will handle it?
Upvotes: 0
Views: 176
Reputation: 505
@Sertug, I got your point. But what about if I also implement the interface MapLoaderLifecycleSupport
will the init
method is called by all members as well? Map store name I set to *
Upvotes: 0
Reputation: 969
When using an IMap, your data is sharded and distributed to cluster members. Those shards can have backups in different members too. Please take a look at the related section of the docs.
So a specific key will be stored on only one of the members, hence only that member's store() implementation will be triggered.
This also means you need to set the MapStore implementation in all members.
Upvotes: 3