Search in sources :

Example 1 with MemberInfoUpdateOperation

use of com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation in project hazelcast by hazelcast.

the class ClusterHeartbeatManager method sendMemberListToOthers.

/** Invoked on the master to send the member list (see {@link MemberInfoUpdateOperation}) to non-master nodes. */
private void sendMemberListToOthers() {
    if (!node.isMaster()) {
        return;
    }
    Collection<MemberImpl> members = clusterService.getMemberImpls();
    List<MemberInfo> memberInfos = createMemberInfoList(members);
    for (MemberImpl member : members) {
        if (member.localMember()) {
            continue;
        }
        MemberInfoUpdateOperation op = new MemberInfoUpdateOperation(member.getUuid(), memberInfos, clusterClock.getClusterTime(), null, false);
        nodeEngine.getOperationService().send(op, member.getAddress());
    }
}
Also used : MemberInfo(com.hazelcast.internal.cluster.MemberInfo) MemberImpl(com.hazelcast.instance.MemberImpl) MemberInfoUpdateOperation(com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation)

Example 2 with MemberInfoUpdateOperation

use of com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation in project hazelcast by hazelcast.

the class ClusterServiceImpl method sendMemberListToMember.

public void sendMemberListToMember(Address target) {
    if (!isMaster()) {
        return;
    }
    if (thisAddress.equals(target)) {
        return;
    }
    MemberImpl member = getMember(target);
    String memberUuid = member != null ? member.getUuid() : null;
    Collection<MemberImpl> members = getMemberImpls();
    MemberInfoUpdateOperation op = new MemberInfoUpdateOperation(memberUuid, createMemberInfoList(members), clusterClock.getClusterTime(), null, false);
    nodeEngine.getOperationService().send(op, target);
}
Also used : MemberImpl(com.hazelcast.instance.MemberImpl) MemberInfoUpdateOperation(com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation)

Aggregations

MemberImpl (com.hazelcast.instance.MemberImpl)2 MemberInfoUpdateOperation (com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation)2 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)1