Search in sources :

Example 1 with ClusterControllerCluster

use of com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerCluster in project vespa by vespa-engine.

the class DomAdminV2Builder method addConfiguredClusterControllers.

private ContainerCluster addConfiguredClusterControllers(AbstractConfigProducer parent, Element admin) {
    Element controllersElements = XML.getChild(admin, "cluster-controllers");
    if (controllersElements == null)
        return null;
    List<Element> controllers = XML.getChildren(controllersElements, "cluster-controller");
    if (controllers.isEmpty())
        return null;
    boolean standaloneZooKeeper = "true".equals(controllersElements.getAttribute(ATTRIBUTE_CLUSTER_CONTROLLER_STANDALONE_ZK)) || multitenant;
    if (standaloneZooKeeper) {
        parent = new ClusterControllerCluster(parent, "standalone");
    }
    ContainerCluster cluster = new ContainerCluster(parent, "cluster-controllers", "cluster-controllers", new ClusterControllerClusterVerifier());
    ContainerModelBuilder.addDefaultHandler_legacyBuilder(cluster);
    List<Container> containers = new ArrayList<>();
    for (Element controller : controllers) {
        ClusterControllerContainer clusterController = new ClusterControllerBuilder(containers.size(), standaloneZooKeeper).build(cluster, controller);
        containers.add(clusterController);
    }
    cluster.addContainers(containers);
    return cluster;
}
Also used : ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) Container(com.yahoo.vespa.model.container.Container) ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) ContainerCluster(com.yahoo.vespa.model.container.ContainerCluster) ClusterControllerClusterVerifier(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerClusterVerifier) ClusterControllerCluster(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerCluster)

Aggregations

ClusterControllerCluster (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerCluster)1 ClusterControllerClusterVerifier (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerClusterVerifier)1 ClusterControllerContainer (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer)1 Container (com.yahoo.vespa.model.container.Container)1 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)1 ArrayList (java.util.ArrayList)1 Element (org.w3c.dom.Element)1