Search in sources :

Example 1 with CoordinatorParameters

use of com.hazelcast.simulator.coordinator.CoordinatorParameters 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)

Aggregations

Coordinator (com.hazelcast.simulator.coordinator.Coordinator)1 CoordinatorParameters (com.hazelcast.simulator.coordinator.CoordinatorParameters)1 Registry (com.hazelcast.simulator.coordinator.registry.Registry)1 File (java.io.File)1