Search in sources :

Example 1 with SplitBrainJoinMessage

use of com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage in project hazelcast by hazelcast.

the class SplitBrainMergeValidationOperation method readInternal.

@Override
protected void readInternal(final ObjectDataInput in) throws IOException {
    request = new SplitBrainJoinMessage();
    request.readData(in);
}
Also used : SplitBrainJoinMessage(com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage)

Example 2 with SplitBrainJoinMessage

use of com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage in project hazelcast by hazelcast.

the class TcpIpJoiner method searchForOtherClusters.

@Override
public void searchForOtherClusters() {
    final Collection<Address> possibleAddresses;
    try {
        possibleAddresses = getPossibleAddresses();
    } catch (Throwable e) {
        logger.severe(e);
        return;
    }
    possibleAddresses.remove(node.getThisAddress());
    possibleAddresses.removeAll(node.getClusterService().getMemberAddresses());
    if (possibleAddresses.isEmpty()) {
        return;
    }
    for (Address address : possibleAddresses) {
        SplitBrainJoinMessage response = sendSplitBrainJoinMessage(address);
        if (shouldMerge(response)) {
            logger.warning(node.getThisAddress() + " is merging [tcp/ip] to " + address);
            setTargetAddress(address);
            startClusterMerge(address);
            return;
        }
    }
}
Also used : Address(com.hazelcast.nio.Address) InetAddress(java.net.InetAddress) SplitBrainJoinMessage(com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage)

Example 3 with SplitBrainJoinMessage

use of com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage in project hazelcast by hazelcast.

the class MockJoiner method searchForOtherClusters.

public void searchForOtherClusters() {
    Collection<Address> possibleAddresses = new ArrayList<Address>(registry.getJoinAddresses());
    possibleAddresses.remove(node.getThisAddress());
    possibleAddresses.removeAll(node.getClusterService().getMemberAddresses());
    SplitBrainJoinMessage request = node.createSplitBrainJoinMessage();
    for (Address address : possibleAddresses) {
        SplitBrainMergeCheckResult result = sendSplitBrainJoinMessageAndCheckResponse(address, request);
        if (result == SplitBrainMergeCheckResult.LOCAL_NODE_SHOULD_MERGE) {
            startClusterMerge(address, request.getMemberListVersion());
            return;
        }
    }
}
Also used : Address(com.hazelcast.cluster.Address) ArrayList(java.util.ArrayList) SplitBrainJoinMessage(com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage) SplitBrainMergeCheckResult(com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage.SplitBrainMergeCheckResult)

Example 4 with SplitBrainJoinMessage

use of com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage in project hazelcast by hazelcast.

the class Node method createSplitBrainJoinMessage.

public SplitBrainJoinMessage createSplitBrainJoinMessage() {
    MemberImpl localMember = getLocalMember();
    boolean liteMember = localMember.isLiteMember();
    Collection<Address> memberAddresses = clusterService.getMemberAddresses();
    int dataMemberCount = clusterService.getSize(DATA_MEMBER_SELECTOR);
    Version clusterVersion = clusterService.getClusterVersion();
    int memberListVersion = clusterService.getMembershipManager().getMemberListVersion();
    return new SplitBrainJoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), version, address, localMember.getUuid(), liteMember, createConfigCheck(), memberAddresses, dataMemberCount, clusterVersion, memberListVersion);
}
Also used : Address(com.hazelcast.cluster.Address) AliasedDiscoveryConfigUtils.allUsePublicAddress(com.hazelcast.internal.config.AliasedDiscoveryConfigUtils.allUsePublicAddress) Version(com.hazelcast.version.Version) MemberVersion(com.hazelcast.version.MemberVersion) MemberImpl(com.hazelcast.cluster.impl.MemberImpl) SplitBrainJoinMessage(com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage)

Aggregations

SplitBrainJoinMessage (com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage)4 Address (com.hazelcast.cluster.Address)2 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)1 SplitBrainMergeCheckResult (com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage.SplitBrainMergeCheckResult)1 AliasedDiscoveryConfigUtils.allUsePublicAddress (com.hazelcast.internal.config.AliasedDiscoveryConfigUtils.allUsePublicAddress)1 Address (com.hazelcast.nio.Address)1 MemberVersion (com.hazelcast.version.MemberVersion)1 Version (com.hazelcast.version.Version)1 InetAddress (java.net.InetAddress)1 ArrayList (java.util.ArrayList)1