Search in sources :

Example 1 with MemberRemoveOperation

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

the class ClusterServiceImpl method sendMemberRemoveOperation.

private void sendMemberRemoveOperation(Member deadMember) {
    for (Member member : getMembers()) {
        Address address = member.getAddress();
        if (!thisAddress.equals(address) && !address.equals(deadMember.getAddress())) {
            MemberRemoveOperation op = new MemberRemoveOperation(deadMember.getAddress(), deadMember.getUuid());
            nodeEngine.getOperationService().send(op, address);
        }
    }
}
Also used : Address(com.hazelcast.nio.Address) MemberRemoveOperation(com.hazelcast.internal.cluster.impl.operations.MemberRemoveOperation) Member(com.hazelcast.core.Member)

Example 2 with MemberRemoveOperation

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

the class AbstractJoiner method checkMembershipIntersectionSetEmpty.

private boolean checkMembershipIntersectionSetEmpty(SplitBrainJoinMessage joinMessage) {
    Collection<Address> targetMemberAddresses = joinMessage.getMemberAddresses();
    if (targetMemberAddresses.contains(node.getThisAddress())) {
        node.nodeEngine.getOperationService().send(new MemberRemoveOperation(node.getThisAddress()), joinMessage.getAddress());
        logger.info(node.getThisAddress() + " CANNOT merge to " + joinMessage.getAddress() + ", because it thinks this-node as its member.");
        return false;
    }
    Collection<Address> thisMemberAddresses = clusterService.getMemberAddresses();
    for (Address address : thisMemberAddresses) {
        if (targetMemberAddresses.contains(address)) {
            logger.info(node.getThisAddress() + " CANNOT merge to " + joinMessage.getAddress() + ", because it thinks " + address + " as its member. " + "But " + address + " is member of this cluster.");
            return false;
        }
    }
    return true;
}
Also used : Address(com.hazelcast.nio.Address) MemberRemoveOperation(com.hazelcast.internal.cluster.impl.operations.MemberRemoveOperation)

Aggregations

MemberRemoveOperation (com.hazelcast.internal.cluster.impl.operations.MemberRemoveOperation)2 Address (com.hazelcast.nio.Address)2 Member (com.hazelcast.core.Member)1