Search in sources :

Example 31 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class MultilevelDispatchTest method requireThatSearchCoverageIsSetInMultilevelSetup.

@Test
public void requireThatSearchCoverageIsSetInMultilevelSetup() throws Exception {
    ContentCluster cr = createCluster(getSimpleDispatchXml() + getCoverage());
    Dispatch tld = cr.getSearch().getIndexed().getTLDs().get(0);
    PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
    tld.getConfig(builder);
    PartitionsConfig config = new PartitionsConfig(builder);
    assertThat(config.dataset().size(), is(1));
    assertEquals(95.0, config.dataset(0).minimal_searchcoverage(), 0.1);
    for (Dispatch dispatch : getDispatchers(tld)) {
        PartitionsConfig.Builder b = new PartitionsConfig.Builder();
        dispatch.getConfig(b);
        PartitionsConfig c = new PartitionsConfig(b);
        assertThat(c.dataset().size(), is(1));
        assertEquals(95.0, c.dataset(0).minimal_searchcoverage(), 0.1);
    }
}
Also used : PartitionsConfig(com.yahoo.vespa.config.search.core.PartitionsConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 32 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class MultilevelDispatchTest method createCluster.

private ContentCluster createCluster(String dispatchXml) throws Exception {
    String[] hosts = { "mh0", "mh1", "mh2", "mh3", "mh4", "mh5" };
    MockRoot root = ContentClusterUtils.createMockRoot(hosts);
    ContentCluster cluster = ContentClusterUtils.createCluster(createClusterXml(getGroupXml(), Optional.of(dispatchXml), 1, 1), root);
    AbstractConfigProducer<Dispatch> dispatchParent = new SimpleConfigProducer<>(root, "tlds");
    HostResource hostResource = new HostResource(new Host(root, "mockhost"));
    IndexedSearchCluster index = cluster.getSearch().getIndexed();
    index.addTld(dispatchParent, hostResource);
    index.setupDispatchGroups();
    root.freezeModelTopology();
    cluster.validate();
    return cluster;
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) MockRoot(com.yahoo.config.model.test.MockRoot) SimpleConfigProducer(com.yahoo.vespa.model.SimpleConfigProducer) Host(com.yahoo.vespa.model.Host) Matchers.containsString(org.hamcrest.Matchers.containsString) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster)

Example 33 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class IndexedHierarchicDistributionTest method requireThatSearchNodesAreCorrectWithTwoGroups.

@Test
public void requireThatSearchNodesAreCorrectWithTwoGroups() throws Exception {
    ContentCluster c = getTwoGroupsCluster();
    List<SearchNode> searchNodes = c.getSearch().getSearchNodes();
    assertEquals(6, searchNodes.size());
    assertSearchNode(0, 0, 0, searchNodes.get(0));
    assertSearchNode(0, 1, 1, searchNodes.get(1));
    assertSearchNode(0, 2, 2, searchNodes.get(2));
    assertSearchNode(1, 0, 3, searchNodes.get(3));
    assertSearchNode(1, 1, 4, searchNodes.get(4));
    assertSearchNode(1, 2, 5, searchNodes.get(5));
}
Also used : SearchNode(com.yahoo.vespa.model.search.SearchNode) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 34 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class IndexedHierarchicDistributionTest method requireThatActivePerLeafGroupIsDefaultWithOneGroup.

@Test
public void requireThatActivePerLeafGroupIsDefaultWithOneGroup() throws Exception {
    ContentCluster c = getOneGroupCluster();
    assertFalse(getStorDistributionConfig(c).active_per_leaf_group());
}
Also used : ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 35 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class IndexedTest method requireProtonStreamingOnly.

@Test
public void requireProtonStreamingOnly() {
    VespaModel model = getStreamingVespaModel();
    HostResource h = model.getHostSystem().getHosts().get(0);
    String[] expectedServices = { "logserver", "configserver", "adminserver", "slobrok", "logd", "configproxy", "config-sentinel", "qrserver", "storagenode", "searchnode", "distributor", "transactionlogserver" };
    // TODO        DomContentBuilderTest.assertServices(h, expectedServices);
    ContentCluster s = model.getContentClusters().get("test");
    assertFalse(s.getSearch().hasIndexedCluster());
    StorServerConfig.Builder builder = new StorServerConfig.Builder();
    s.getStorageNodes().getConfig(builder);
    s.getStorageNodes().getChildren().get("3").getConfig(builder);
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) VespaModel(com.yahoo.vespa.model.VespaModel) StorServerConfig(com.yahoo.vespa.config.content.core.StorServerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Aggregations

ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)83 Test (org.junit.Test)70 VespaModel (com.yahoo.vespa.model.VespaModel)22 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)20 ContentSearchCluster (com.yahoo.vespa.model.content.ContentSearchCluster)18 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)16 VespaModelTester (com.yahoo.vespa.model.test.VespaModelTester)15 MockRoot (com.yahoo.config.model.test.MockRoot)7 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)7 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)6 PartitionsConfig (com.yahoo.vespa.config.search.core.PartitionsConfig)5 HostResource (com.yahoo.vespa.model.HostResource)5 SearchNode (com.yahoo.vespa.model.search.SearchNode)5 Matchers.containsString (org.hamcrest.Matchers.containsString)5 StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)4 ProtonConfig (com.yahoo.vespa.config.search.core.ProtonConfig)4 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)4 VDSEngine (com.yahoo.vespa.model.content.engines.VDSEngine)4 StorServerConfig (com.yahoo.vespa.config.content.core.StorServerConfig)3 ConfigChangeAction (com.yahoo.config.model.api.ConfigChangeAction)2