Search in sources :

Example 1 with ClusterControllerContainer

use of com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer 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)

Example 2 with ClusterControllerContainer

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

the class ContainerClusterTest method addClusterController.

private static void addClusterController(ContainerCluster cluster, String hostName) {
    Container container = new ClusterControllerContainer(cluster, 1, false);
    container.setHostResource(new HostResource(new Host(null, hostName)));
    container.initService();
    cluster.addContainer(container);
}
Also used : ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) HostResource(com.yahoo.vespa.model.HostResource) ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) Host(com.yahoo.vespa.model.Host)

Example 3 with ClusterControllerContainer

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

the class ContainerClusterTest method testClusterControllerResourceUsage.

@Test
public void testClusterControllerResourceUsage() {
    ContainerCluster cluster = createClusterControllerCluster();
    addClusterController(cluster, "host-c1");
    assertEquals(1, cluster.getContainers().size());
    ClusterControllerContainer container = (ClusterControllerContainer) cluster.getContainers().get(0);
    QrStartConfig.Builder qrBuilder = new QrStartConfig.Builder();
    container.getConfig(qrBuilder);
    QrStartConfig qrStartConfig = new QrStartConfig(qrBuilder);
    assertEquals(512, qrStartConfig.jvm().heapsize());
    ThreadpoolConfig.Builder tpBuilder = new ThreadpoolConfig.Builder();
    cluster.getConfig(tpBuilder);
    ThreadpoolConfig threadpoolConfig = new ThreadpoolConfig(tpBuilder);
    assertEquals(10, threadpoolConfig.maxthreads());
}
Also used : ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) ThreadpoolConfig(com.yahoo.container.handler.ThreadpoolConfig) QrStartConfig(com.yahoo.search.config.QrStartConfig) Test(org.junit.Test)

Aggregations

ClusterControllerContainer (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer)3 ThreadpoolConfig (com.yahoo.container.handler.ThreadpoolConfig)1 QrStartConfig (com.yahoo.search.config.QrStartConfig)1 Host (com.yahoo.vespa.model.Host)1 HostResource (com.yahoo.vespa.model.HostResource)1 ClusterControllerCluster (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerCluster)1 ClusterControllerClusterVerifier (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerClusterVerifier)1 Container (com.yahoo.vespa.model.container.Container)1 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 Element (org.w3c.dom.Element)1