use of com.hazelcast.config.JoinConfig in project SSM by Intel-bigdata.
the class HazelcastInstanceProvider method addMemberConfig.
public static void addMemberConfig(ClasspathXmlConfig config) {
NetworkConfig network = config.getNetworkConfig();
JoinConfig join = network.getJoin();
String serverConfFile = new Configuration().get(SmartConfKeys.SMART_CONF_DIR_KEY, SmartConfKeys.SMART_CONF_DIR_DEFAULT) + "/servers";
Scanner sc = null;
try {
sc = new Scanner(new File(serverConfFile));
} catch (FileNotFoundException ex) {
LOG.error("Cannot find the config file: {}!", serverConfFile);
}
if (sc != null) {
while (sc.hasNextLine()) {
String host = sc.nextLine().trim();
if (!host.startsWith("#") && !host.isEmpty()) {
join.getTcpIpConfig().addMember(host);
}
}
}
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class PartitionServiceBeanDTOTest method getConfig.
@Override
protected Config getConfig() {
Config config = new Config();
// Join is disabled intentionally. will start standalone HazelcastInstance.
NetworkConfig networkConfig = config.getNetworkConfig();
JoinConfig join = networkConfig.getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(false);
return config;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class DefaultAddressPicker method preferIPv4Stack.
private boolean preferIPv4Stack() {
boolean preferIPv4Stack = Boolean.getBoolean("java.net.preferIPv4Stack") || hazelcastProperties.getBoolean(GroupProperty.PREFER_IPv4_STACK);
// AWS does not support IPv6
JoinConfig join = config.getNetworkConfig().getJoin();
AwsConfig awsConfig = join.getAwsConfig();
boolean awsEnabled = awsConfig != null && awsConfig.isEnabled();
return preferIPv4Stack || awsEnabled;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class Node method createJoiner.
Joiner createJoiner() {
JoinConfig join = config.getNetworkConfig().getJoin();
join.verify();
if (properties.getBoolean(DISCOVERY_SPI_ENABLED)) {
//TODO: Auto-Upgrade Multicast+AWS configuration!
logger.info("Activating Discovery SPI Joiner");
return new DiscoveryJoiner(this, discoveryService, properties.getBoolean(DISCOVERY_SPI_PUBLIC_IP_ENABLED));
} else {
if (join.getMulticastConfig().isEnabled() && multicastService != null) {
logger.info("Creating MulticastJoiner");
return new MulticastJoiner(this);
} else if (join.getTcpIpConfig().isEnabled()) {
logger.info("Creating TcpIpJoiner");
return new TcpIpJoiner(this);
} else if (join.getAwsConfig().isEnabled()) {
Class clazz;
try {
logger.info("Creating AWSJoiner");
clazz = Class.forName("com.hazelcast.cluster.impl.TcpIpJoinerOverAWS");
Constructor constructor = clazz.getConstructor(Node.class);
return (Joiner) constructor.newInstance(this);
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
}
return null;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class NodeExtensionTest method getConfig.
protected Config getConfig() {
Config config = new Config();
NetworkConfig networkConfig = config.getNetworkConfig();
JoinConfig join = networkConfig.getJoin();
join.getMulticastConfig().setEnabled(false);
return config;
}
Aggregations