use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class AgentsFile method save.
public static void save(File agentsFile, Registry registry) {
StringBuilder sb = new StringBuilder();
for (AgentData agent : registry.getAgents()) {
String publicAddress = agent.getPublicAddress();
String privateAddress = agent.getPrivateAddress();
if (publicAddress.equals(privateAddress)) {
sb.append(publicAddress);
} else {
sb.append(publicAddress).append(',').append(privateAddress);
}
Map<String, String> tags = agent.getTags();
if (!tags.isEmpty()) {
sb.append('|').append(tagsToString(tags));
}
sb.append(NEW_LINE);
}
writeText(sb.toString(), agentsFile);
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class DeploymentPlan method addToPlan.
public DeploymentPlan addToPlan(int workerCount, String workerType) {
for (int i = 0; i < workerCount; i++) {
WorkersPerAgent workersPerAgent = nextAgent(workerType);
AgentData agent = workersPerAgent.agent;
WorkerParameters workerParameters = vendorDriver.loadWorkerParameters(workerType, agent.getAddressIndex());
workersPerAgent.registerWorker(workerParameters);
List<WorkerParameters> workerParametersList = workerDeployment.get(agent.getAddress());
workerParametersList.add(workerParameters);
}
return this;
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class HazelcastDriverTest method before.
@Before
public void before() {
simulatorProperties = new SimulatorProperties();
agent = new AgentData(1, SimulatorUtils.localIp(), SimulatorUtils.localIp());
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class DeploymentPlanTest method testGetVersionSpecs_noWorkersOnSecondAgent.
@Test
public void testGetVersionSpecs_noWorkersOnSecondAgent() {
AgentData agent1 = new AgentData(1, "172.16.16.1", "127.0.0.1");
AgentData agent2 = new AgentData(2, "172.16.16.2", "127.0.0.1");
testGetVersionSpecs(asList(agent1, agent2), 1, 0);
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class Wizard method sshConnectionCheck.
void sshConnectionCheck(SimulatorProperties simulatorProperties, Bash bash) {
if (isLocal(simulatorProperties)) {
throw new CommandLineExitException("SSH is not supported for local setups.");
}
Registry registry = loadComponentRegister(agentFile, true);
String userName = simulatorProperties.getUser();
for (AgentData agent : registry.getAgents()) {
String publicAddress = agent.getPublicAddress();
echo("Connecting to %s@%s...", userName, publicAddress);
bash.ssh(publicAddress, "echo ok 2>&1");
}
echo("Connected successfully to all remote machines!");
}
Aggregations