use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class AdvancedNetworkIntegrationTest method prepareConfigs.
private Tuple2<Config, Config> prepareConfigs() {
Config config = smallInstanceConfig();
config.getAdvancedNetworkConfig().setEnabled(true);
config.getAdvancedNetworkConfig().setMemberEndpointConfig(createServerSocketConfig(firstMemberPort)).setClientEndpointConfig(createServerSocketConfig(firstClientPort));
JoinConfig joinConfig = config.getAdvancedNetworkConfig().getJoin();
joinConfig.getTcpIpConfig().setEnabled(true).addMember("127.0.0.1:" + secondMemberPort);
Config other = smallInstanceConfig();
other.getAdvancedNetworkConfig().setEnabled(true);
other.getAdvancedNetworkConfig().setMemberEndpointConfig(createServerSocketConfig(secondMemberPort));
other.setProperty(ClusterProperty.MAX_JOIN_SECONDS.getName(), "1");
return Tuple2.tuple2(config, other);
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class AbstractAdvancedNetworkIntegrationTest method configureTcpIpConfig.
void configureTcpIpConfig(Config config) {
JoinConfig join = config.getAdvancedNetworkConfig().getJoin();
join.getTcpIpConfig().addMember("127.0.0.1:" + NOT_OPENED_PORT).setEnabled(true);
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class NioChannelMemoryLeakTest method getConfig.
@Override
protected Config getConfig() {
Config config = new Config();
JoinConfig join = config.getNetworkConfig().getJoin();
join.getTcpIpConfig().addMember("127.0.0.1").setEnabled(true);
join.getMulticastConfig().setEnabled(false);
return config;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class TestAwareInstanceFactory method newHazelcastInstance.
/**
* Creates new member instance with TCP join configured. Uses
* {@link com.hazelcast.test.AbstractHazelcastClassRunner#getTestMethodName()}
* as the cluster name if it's not changed already.
*/
public HazelcastInstance newHazelcastInstance(Config config, NodeContext nodeCtx) {
if (config == null) {
config = new Config();
}
if (DEFAULT_CLUSTER_NAME.equals(config.getClusterName())) {
config.setClusterName(getTestMethodName());
}
List<HazelcastInstance> members = getOrInitInstances(perMethodMembers);
// Prepare Unified Networking (legacy)
NetworkConfig unifiedNetworkingConfig = config.getNetworkConfig();
unifiedNetworkingConfig.setPort(PORT.getAndIncrement());
JoinConfig unifiedJoinConfig = unifiedNetworkingConfig.getJoin();
unifiedJoinConfig.getMulticastConfig().setEnabled(false);
TcpIpConfig unifiedTcpIpConfig = unifiedJoinConfig.getTcpIpConfig().setEnabled(true);
for (HazelcastInstance member : members) {
unifiedTcpIpConfig.addMember("127.0.0.1:" + getPort(member, MEMBER));
}
// Prepare Advanced Networking - Will be disabled by default but properly configured if needed
AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
ServerSocketEndpointConfig memberEndpointConfig = (ServerSocketEndpointConfig) advancedNetworkConfig.getEndpointConfigs().get(MEMBER);
memberEndpointConfig.setPort(PORT.getAndIncrement());
JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
advancedJoinConfig.getMulticastConfig().setEnabled(false);
TcpIpConfig advancedTcpIpConfig = advancedJoinConfig.getTcpIpConfig().setEnabled(true);
for (HazelcastInstance member : members) {
advancedTcpIpConfig.addMember("127.0.0.1:" + getPort(member, MEMBER));
}
HazelcastInstance hz = HazelcastInstanceFactory.newHazelcastInstance(config, config.getInstanceName(), nodeCtx);
members.add(hz);
int nextPort = getPort(hz, MEMBER) + 1;
int current;
while (nextPort > (current = PORT.get())) {
PORT.compareAndSet(current, nextPort);
}
return hz;
}
use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.
the class WanOpenSourceAntiEntropyMcEventsTest method getConfigWithRest.
private Config getConfigWithRest() {
Config config = smallInstanceConfig();
RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
restApiConfig.setEnabled(true);
restApiConfig.enableGroups(RestEndpointGroup.WAN);
JoinConfig joinConfig = config.getNetworkConfig().getJoin();
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getTcpIpConfig().setEnabled(true).addMember("127.0.0.1");
return config;
}
Aggregations