如果成员加入集群,是否会在 hazelcast #addLocalEntryListener 上触发 remove/evicted 事件?
Gets a remove/evicted event fired on hazelcast #addLocalEntryListener if a member joins a cluster?
来自文档:
Note that entries in distributed map are partitioned across the cluster members; each member owns and manages the some portion of the entries. Owned entries are called local entries. This listener will be listening for the events of local entries. Let's say your cluster has member1 and member2. On member2 you added a local listener and from member1, you call map.put(key2, value2). If the key2 is owned by member2 then the local listener will be notified for the add/update event. Also note that entries can migrate to other nodes for load balancing and/or membership change.
最后一句话是否意味着,如果一个成员加入一个集群并且一个键将移动到一个新节点,一个 "EntryRemoved" 事件会在本地节点上触发(意味着本地节点现在不是所有者节点)?我可以相信这种行为吗?
不,EntryRemoved
事件仅在您明确删除条目时触发。
来自文档:
Note that entries in distributed map are partitioned across the cluster members; each member owns and manages the some portion of the entries. Owned entries are called local entries. This listener will be listening for the events of local entries. Let's say your cluster has member1 and member2. On member2 you added a local listener and from member1, you call map.put(key2, value2). If the key2 is owned by member2 then the local listener will be notified for the add/update event. Also note that entries can migrate to other nodes for load balancing and/or membership change.
最后一句话是否意味着,如果一个成员加入一个集群并且一个键将移动到一个新节点,一个 "EntryRemoved" 事件会在本地节点上触发(意味着本地节点现在不是所有者节点)?我可以相信这种行为吗?
不,EntryRemoved
事件仅在您明确删除条目时触发。