Reputation: 1
I'm using Hazelcast's iMap.executeOnKeys() method like this:
iMap.executeOnKeys(localMap.keySet(), new myEntryProcessor(localMap));
Where localMap contains keys that may be distributed across multiple partitions. Smart routing is enabled with the Hazelcast client.
I have a few questions regarding the efficiency and routing of this operation:
Smart Routing - Is the executeOnKeys operation routed smartly at the client side? Specifically, are keys that belong to the same partition sent directly to the member that owns that partition?
Efficiency with Partition Aggregation - If I aggregate the keys by their partitions using Hazelcast’s partitionService.getPartition(key) and then provide these aggregated keys to executeOnKeys, would this approach yield better efficiency compared to directly supplying the keys without aggregation?
Does making key partitionaware has any advantages compared to aggregating the keys by their partitions using Hazelcast’s partitionService.getPartition(key)
Any insights or recommendations on optimizing this operation would be greatly appreciated!
Upvotes: 0
Views: 43
Reputation: 702
The client sends all keys to a random member, which then forwards the keys to their corresponding partitions. The idea behind this is:
It is better not to implement complex logic on the client side; otherwise, the client will become tightly coupled with the routing mode.
Upvotes: 1