use of com.hazelcast.internal.cluster.impl.TcpIpJoiner in project hazelcast by hazelcast.
the class JoinMastershipClaimOp method run.
@Override
public void run() {
final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
Node node = nodeEngine.getNode();
Joiner joiner = node.getJoiner();
ClusterServiceImpl clusterService = node.getClusterService();
final ILogger logger = node.getLogger(getClass().getName());
if (joiner instanceof TcpIpJoiner) {
TcpIpJoiner tcpIpJoiner = (TcpIpJoiner) joiner;
final Address endpoint = getCallerAddress();
final Address masterAddress = clusterService.getMasterAddress();
approvedAsMaster = !tcpIpJoiner.isClaimingMastership() && !clusterService.isMaster() && (masterAddress == null || masterAddress.equals(endpoint));
} else {
approvedAsMaster = false;
logger.warning("This node requires MulticastJoin strategy!");
}
if (logger.isFineEnabled()) {
logger.fine("Sending '" + approvedAsMaster + "' for master claim of node: " + getCallerAddress());
}
}
use of com.hazelcast.internal.cluster.impl.TcpIpJoiner in project hazelcast by hazelcast.
the class Node method createJoiner.
Joiner createJoiner() {
JoinConfig join = getActiveMemberNetworkConfig(config).getJoin();
join.verify();
if (shouldUseMulticastJoiner(join) && multicastService != null) {
logger.info("Using Multicast discovery");
return new MulticastJoiner(this);
} else if (join.getTcpIpConfig().isEnabled()) {
logger.info("Using TCP/IP discovery");
return new TcpIpJoiner(this);
} else if (properties.getBoolean(DISCOVERY_SPI_ENABLED) || isAnyAliasedConfigEnabled(join) || join.isAutoDetectionEnabled()) {
logger.info("Using Discovery SPI");
return new DiscoveryJoiner(this, discoveryService, usePublicAddress(join));
}
return null;
}
Aggregations