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;
}
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);
}
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());
}
Aggregations