use of com.yahoo.vespa.clustercontroller.core.FleetController in project vespa by vespa-engine.
the class ClusterController method setOptions.
public void setOptions(String clusterName, FleetControllerOptions options, Metric metricImpl) throws Exception {
metricWrapper.updateMetricImplementation(metricImpl);
if (options.zooKeeperServerAddress != null && !"".equals(options.zooKeeperServerAddress)) {
// Wipe this path ... it's unclear why
String path = "/" + options.clusterName + options.fleetControllerIndex;
Curator curator = Curator.create(options.zooKeeperServerAddress);
if (curator.framework().checkExists().forPath(path) != null)
curator.framework().delete().deletingChildrenIfNeeded().forPath(path);
curator.framework().create().creatingParentsIfNeeded().forPath(path);
}
synchronized (controllers) {
FleetController controller = controllers.get(clusterName);
if (controller == null) {
StatusHandler.ContainerStatusPageServer statusPageServer = new StatusHandler.ContainerStatusPageServer();
controller = FleetController.createForContainer(options, statusPageServer, metricWrapper);
controllers.put(clusterName, controller);
status.put(clusterName, statusPageServer);
} else {
controller.updateOptions(options, 0);
}
}
}
Aggregations