Search in sources :

Example 1 with FleetController

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);
        }
    }
}
Also used : StatusHandler(com.yahoo.vespa.clustercontroller.core.status.StatusHandler) FleetController(com.yahoo.vespa.clustercontroller.core.FleetController) Curator(com.yahoo.vespa.curator.Curator)

Aggregations

FleetController (com.yahoo.vespa.clustercontroller.core.FleetController)1 StatusHandler (com.yahoo.vespa.clustercontroller.core.status.StatusHandler)1 Curator (com.yahoo.vespa.curator.Curator)1