use of org.neo4j.cluster.client.Cluster in project neo4j by neo4j.
the class ClusterManager method start.
@Override
public void start() throws Throwable {
FreePorts.Session session = PORTS.newSession();
Cluster cluster = clustersProvider.apply(session);
life = new LifeSupport();
life.add(new LifecycleAdapter() {
@Override
public void shutdown() throws Throwable {
session.close();
}
});
// Started so instances added here will be started immediately, and in case of exceptions they can be
// shutdown() or stop()ped properly
life.start();
managedCluster = new ManagedCluster(cluster, session);
life.add(managedCluster);
availabilityChecks.forEach(managedCluster::await);
if (initialDatasetCreator != null) {
initialDatasetCreator.receive(managedCluster.getMaster());
managedCluster.sync();
}
}
Aggregations