use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class Provisioner method installSimulator.
void installSimulator() {
onlineCheckAgents(properties, registry);
ensureIsRemoteSetup(properties, "install");
long started = System.nanoTime();
logWithRuler("Installing Simulator on %d machines...", registry.agentCount());
ThreadSpawner spawner = new ThreadSpawner("installSimulator", true);
for (final AgentData agent : registry.getAgents()) {
spawner.spawn(new Runnable() {
@Override
public void run() {
log(" Installing Simulator on %s", agent.getPublicAddress());
installSimulator(agent.getPublicAddress());
log(" Finished installing Simulator on %s", agent.getPublicAddress());
}
});
}
spawner.awaitCompletion();
long elapsed = getElapsedSeconds(started);
logWithRuler("Finished installing Simulator on %d machines (%s seconds)", registry.agentCount(), elapsed);
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class Provisioner method installJava.
void installJava() {
onlineCheckAgents(properties, registry);
ensureIsRemoteSetup(properties, "installJava");
long started = System.nanoTime();
logWithRuler("Installing Java on %d machines...", registry.agentCount());
ThreadSpawner spawner = new ThreadSpawner("installJava", true);
for (final AgentData agent : registry.getAgents()) {
spawner.spawn(new Runnable() {
@Override
public void run() {
log("Installing Java on %s", agent.getPublicAddress());
installJava(agent.getPublicAddress());
}
});
}
spawner.awaitCompletion();
long elapsed = getElapsedSeconds(started);
logWithRuler("Finished installing Java on %d machines (%s seconds)", registry.agentCount(), elapsed);
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class CoordinatorCliTest method testInit_withLocalSetup.
@Test
public void testInit_withLocalSetup() {
File simulatorProperties = new File(getUserDir(), "simulator.properties").getAbsoluteFile();
writeText(format("%s=%s", CLOUD_PROVIDER, CloudProviderUtils.PROVIDER_LOCAL), simulatorProperties);
writeText("COORDINATOR_PORT=5000\n", simulatorProperties);
try {
CoordinatorCli cli = createCoordinatorCli();
Registry registry = cli.registry;
assertEquals(1, registry.agentCount());
AgentData firstAgent = registry.getFirstAgent();
assertEquals("localhost", firstAgent.getPublicAddress());
assertEquals("localhost", firstAgent.getPrivateAddress());
} finally {
deleteQuiet(simulatorProperties);
}
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class AgentsFileTest method testLoad_publicAndPrivateAddress.
@Test
public void testLoad_publicAndPrivateAddress() {
writeText("192.168.1.1,10.10.10.10", agentsFile);
registry = load(agentsFile);
assertEquals(1, registry.agentCount());
AgentData agentData = registry.getFirstAgent();
assertEquals("192.168.1.1", agentData.getPublicAddress());
assertEquals("10.10.10.10", agentData.getPrivateAddress());
}
use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.
the class AgentsFileTest method testLoad_fileContainsComments.
@Test
public void testLoad_fileContainsComments() {
writeText("192.168.1.1#foo" + NEW_LINE + "#bar", agentsFile);
registry = load(agentsFile);
assertEquals(1, registry.agentCount());
AgentData agentData = registry.getFirstAgent();
assertEquals("192.168.1.1", agentData.getPublicAddress());
assertEquals("192.168.1.1", agentData.getPrivateAddress());
}
Aggregations