use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class ModelProvisioningTest method testRequestingSpecificFlavors.
@Test
public void testRequestingSpecificFlavors() {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<services>" + " <admin version='4.0'>" + " <logservers><nodes count='1' dedicated='true' flavor='logserver-flavor'/></logservers>" + " <slobroks><nodes count='2' dedicated='true' flavor='slobrok-flavor'/></slobroks>" + " </admin>" + " <container version='1.0' id='container'>" + " <nodes count='4' flavor='container-flavor'/>" + " </container>" + " <content version='1.0' id='foo'>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " <controllers><nodes count='2' dedicated='true' flavor='controller-foo-flavor'/></controllers>" + " <nodes count='5' flavor='content-foo-flavor'/>" + " </content>" + " <content version='1.0' id='bar'>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " <controllers><nodes count='3' dedicated='true' flavor='controller-bar-flavor'/></controllers>" + " <nodes count='6' flavor='content-bar-flavor'/>" + " </content>" + "</services>";
int totalHosts = 23;
VespaModelTester tester = new VespaModelTester();
tester.addHosts("logserver-flavor", 1);
tester.addHosts("slobrok-flavor", 2);
tester.addHosts("container-flavor", 4);
tester.addHosts("controller-foo-flavor", 2);
tester.addHosts("content-foo-flavor", 5);
tester.addHosts("controller-bar-flavor", 3);
tester.addHosts("content-bar-flavor", 6);
// fails unless the right flavors+counts are requested
VespaModel model = tester.createModel(services, true, 0);
assertThat(model.getRoot().getHostSystem().getHosts().size(), is(totalHosts));
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class ModelProvisioningTest method testClusterControllersWithGroupSize2.
@Test
public void testClusterControllersWithGroupSize2() {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<services>" + " <admin version='4.0'/>" + " <container version='1.0' id='foo'>" + " <nodes count='10'/>" + " </container>" + " <content version='1.0' id='bar'>" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " <nodes count='8' groups='4'/>" + " </content>" + "</services>";
int numberOfHosts = 18;
VespaModelTester tester = new VespaModelTester();
tester.addHosts(numberOfHosts);
VespaModel model = tester.createModel(services, true);
assertThat(model.getRoot().getHostSystem().getHosts().size(), is(numberOfHosts));
// Check content clusters
ContentCluster cluster = model.getContentClusters().get("bar");
ContainerCluster clusterControllers = cluster.getClusterControllers();
assertEquals("We get the closest odd number", 3, clusterControllers.getContainers().size());
assertEquals("bar-controllers", clusterControllers.getName());
assertEquals("default01", clusterControllers.getContainers().get(0).getHostName());
assertEquals("default03", clusterControllers.getContainers().get(1).getHostName());
assertEquals("default08", clusterControllers.getContainers().get(2).getHostName());
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class ModelProvisioningTest method testExplicitDedicatedClusterControllers.
@Test
public void testExplicitDedicatedClusterControllers() {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<services>" + " <container version='1.0' id='foo'>" + " <nodes count='10'/>" + " </container>" + " <content version='1.0' id='bar'>" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " <controllers><nodes dedicated='true' count='4'/></controllers>" + " <nodes count='9' groups='3'/>" + " </content>" + "</services>";
int numberOfHosts = 23;
VespaModelTester tester = new VespaModelTester();
tester.addHosts(numberOfHosts);
VespaModel model = tester.createModel(services, true);
assertThat(model.getRoot().getHostSystem().getHosts().size(), is(numberOfHosts));
// Check content clusters
ContentCluster cluster = model.getContentClusters().get("bar");
ContainerCluster clusterControllers = cluster.getClusterControllers();
assertEquals(4, clusterControllers.getContainers().size());
assertEquals("bar-controllers", clusterControllers.getName());
assertEquals("default04", clusterControllers.getContainers().get(0).getHostName());
assertEquals("default03", clusterControllers.getContainers().get(1).getHostName());
assertEquals("default02", clusterControllers.getContainers().get(2).getHostName());
assertEquals("default01", clusterControllers.getContainers().get(3).getHostName());
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class ModelProvisioningTest method require_that_proton_config_is_tuned_based_on_node_flavor.
@Test
public void require_that_proton_config_is_tuned_based_on_node_flavor() {
String services = joinLines("<?xml version='1.0' encoding='utf-8' ?>", "<services>", " <content version='1.0' id='test'>", " <documents>", " <document type='type1' mode='index'/>", " </documents>", " <nodes count='2' flavor='content-test-flavor'/>", " </content>", "</services>");
VespaModelTester tester = new VespaModelTester();
tester.addHosts(createFlavorFromDiskSetting("content-test-flavor", false), 2);
VespaModel model = tester.createModel(services, true, 0);
ContentSearchCluster cluster = model.getContentClusters().get("test").getSearch();
assertEquals(2, cluster.getSearchNodes().size());
assertEquals(40, getProtonConfig(cluster, 0).hwinfo().disk().writespeed(), 0.001);
assertEquals(40, getProtonConfig(cluster, 1).hwinfo().disk().writespeed(), 0.001);
}
use of com.yahoo.vespa.model.VespaModel in project vespa by vespa-engine.
the class ModelProvisioningTest method testJDiscOnly.
@Test
public void testJDiscOnly() {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<jdisc version='1.0'>" + " <search/>" + " <nodes count='3'/>" + "</jdisc>";
int numberOfHosts = 3;
VespaModelTester tester = new VespaModelTester();
tester.addHosts(numberOfHosts);
VespaModel model = tester.createModel(services, true);
assertEquals(numberOfHosts, model.getRoot().getHostSystem().getHosts().size());
assertEquals(3, model.getContainerClusters().get("jdisc").getContainers().size());
assertNotNull(model.getAdmin().getLogserver());
assertEquals(3, model.getAdmin().getSlobroks().size());
}
Aggregations