use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class HazelcastDriver method createAddressConfig.
public static String createAddressConfig(String tagName, List<AgentData> agents, String port) {
StringBuilder members = new StringBuilder();
for (AgentData agent : agents) {
String hostAddress = agent.getPrivateAddress();
members.append(format("<%s>%s:%s</%s>%n", tagName, hostAddress, port, tagName));
}
return members.toString();
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class HazelcastUtilsTest method getComponentRegistryMock.
private Registry getComponentRegistryMock() {
List<AgentData> agents = new ArrayList<AgentData>();
for (int i = 1; i <= 5; i++) {
AgentData agent = mock(AgentData.class);
when(agent.getPrivateAddress()).thenReturn("192.168.0." + i);
agents.add(agent);
}
Registry registry = mock(Registry.class);
when(registry.getAgents()).thenReturn(agents);
return registry;
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class InfinispanDriver method initialHosts.
private String initialHosts(boolean clientMode) {
String port = clientMode ? "11222" : get("HAZELCAST_PORT");
StringBuilder sb = new StringBuilder();
boolean first = true;
for (AgentData agent : agents) {
if (first) {
first = false;
} else if (clientMode) {
sb.append(';');
} else {
sb.append(',');
}
if (clientMode) {
sb.append(agent.getPrivateAddress()).append(":").append(port);
} else {
sb.append(agent.getPrivateAddress()).append("[").append(port).append("]");
}
}
return sb.toString();
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class JetDriver method createAddressConfig.
public static String createAddressConfig(String tagName, List<AgentData> agents, String port) {
StringBuilder members = new StringBuilder();
for (AgentData agent : agents) {
String hostAddress = agent.getPrivateAddress();
members.append(format("<%s>%s:%s</%s>%n", tagName, hostAddress, port, tagName));
}
return members.toString();
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class IgniteDriver method loadServerOrNativeClientConfig.
private String loadServerOrNativeClientConfig(boolean client) {
String config = loadConfiguration("Ignite configuration", "ignite.xml");
ConfigFileTemplate template = new ConfigFileTemplate(config).withAgents(agents);
StringBuilder addresses = new StringBuilder();
for (AgentData agent : agents) {
addresses.append("<value>").append(agent.getPrivateAddress()).append("</value>");
}
template.addReplacement("<!--ADDRESSES-->", addresses.toString());
template.addReplacement("<!--CLIENT_MODE-->", client);
return template.render();
}
Aggregations