Search in sources :

Example 1 with Coordinator

use of com.hazelcast.simulator.coordinator.Coordinator in project hazelcast-simulator by hazelcast.

the class Runner method newCoordinator.

private Coordinator newCoordinator() {
    CoordinatorParameters parameters = new CoordinatorParameters().setSkipShutdownHook(true).setSimulatorProperties(options.simulatorProperties);
    if (options.sessionId != null) {
        parameters.setSessionId(options.sessionId);
    }
    Registry registry;
    if ("local".equals(options.simulatorProperties.getCloudProvider())) {
        registry = new Registry();
        registry.addAgent("localhost", "localhost");
    } else {
        registry = loadComponentRegister(new File("agents.txt"));
    }
    Coordinator coordinator = new Coordinator(registry, parameters);
    try {
        coordinator.start();
    } catch (Exception e) {
        // todo
        throw new RuntimeException(e);
    }
    return coordinator;
}
Also used : CoordinatorParameters(com.hazelcast.simulator.coordinator.CoordinatorParameters) Registry(com.hazelcast.simulator.coordinator.registry.Registry) Coordinator(com.hazelcast.simulator.coordinator.Coordinator) File(java.io.File)

Example 2 with Coordinator

use of com.hazelcast.simulator.coordinator.Coordinator in project hazelcast-simulator by hazelcast.

the class Runner method run.

public void run() throws Exception {
    prepareClassPathForUploading();
    Coordinator coordinator = newCoordinator();
    try {
        startMembers(coordinator);
        startClients(coordinator);
        TestSuite suite = newTestSuite();
        coordinator.testRun(new RcTestRunOperation(suite));
    } finally {
        coordinator.close();
    }
}
Also used : TestSuite(com.hazelcast.simulator.coordinator.TestSuite) Coordinator(com.hazelcast.simulator.coordinator.Coordinator) RcTestRunOperation(com.hazelcast.simulator.coordinator.operations.RcTestRunOperation)

Aggregations

Coordinator (com.hazelcast.simulator.coordinator.Coordinator)2 CoordinatorParameters (com.hazelcast.simulator.coordinator.CoordinatorParameters)1 TestSuite (com.hazelcast.simulator.coordinator.TestSuite)1 RcTestRunOperation (com.hazelcast.simulator.coordinator.operations.RcTestRunOperation)1 Registry (com.hazelcast.simulator.coordinator.registry.Registry)1 File (java.io.File)1