Search in sources :

Example 81 with ContentCluster

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

the class StorageModelTestCase method testMetricsSnapshotIntervalYAMAS.

@Test
public void testMetricsSnapshotIntervalYAMAS() throws Exception {
    VespaModel vespaModel = createModel("src/test/cfg/storage/clustercontroller_advanced");
    ContentCluster contentCluster = vespaModel.getContentClusters().values().iterator().next();
    assertNotNull(contentCluster);
    MetricsmanagerConfig.Builder builder = new MetricsmanagerConfig.Builder();
    contentCluster.getConfig(builder);
    MetricsmanagerConfig config = new MetricsmanagerConfig(builder);
    assertThat(config.snapshot().periods(0), is(60));
}
Also used : VespaModel(com.yahoo.vespa.model.VespaModel) MetricsmanagerConfig(com.yahoo.metrics.MetricsmanagerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 82 with ContentCluster

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

the class MultilevelDispatchTest method requireThatDispatchGroupsCanBeAutomaticallySetup.

@Test
public void requireThatDispatchGroupsCanBeAutomaticallySetup() throws Exception {
    ContentCluster cr = createCluster(getSimpleDispatchXml());
    IndexedSearchCluster ix = cr.getSearch().getIndexed();
    Dispatch tld = cr.getSearch().getIndexed().getTLDs().get(0);
    assertEquals("tlds/tld.0", tld.getConfigId());
    assertEquals(0, getFdispatchrcConfig(tld).dispatchlevel());
    new EngineAsserter(2, 6, tld).assertEngine(0, 0, "tcp/mh0:19113").assertEngine(1, 0, "tcp/mh1:19113").assertEngine(2, 0, "tcp/mh2:19113").assertEngine(0, 1, "tcp/mh3:19113").assertEngine(1, 1, "tcp/mh4:19113").assertEngine(2, 1, "tcp/mh5:19113");
    List<Dispatch> ds = getDispatchers(tld);
    assertEquals(6, ds.size());
    {
        // dispatch group 1
        Dispatch[] dispatchers = { ds.get(0), ds.get(1), ds.get(2) };
        String[] specs = { "tcp/mh0:19104", "tcp/mh1:19104", "tcp/mh2:19104" };
        SearchNode[] searchNodes = { ix.getSearchNode(0), ix.getSearchNode(1), ix.getSearchNode(2) };
        assertDispatchAndSearchNodes(0, dispatchers, specs, searchNodes);
    }
    {
        // dispatch group 2
        Dispatch[] dispatchers = { ds.get(3), ds.get(4), ds.get(5) };
        String[] specs = { "tcp/mh3:19104", "tcp/mh4:19104", "tcp/mh5:19104" };
        SearchNode[] searchNodes = { ix.getSearchNode(3), ix.getSearchNode(4), ix.getSearchNode(5) };
        assertDispatchAndSearchNodes(1, dispatchers, specs, searchNodes);
    }
}
Also used : ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 83 with ContentCluster

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

the class MultilevelDispatchTest method requireThatMaxHitsIsScaled.

@Test
public void requireThatMaxHitsIsScaled() throws Exception {
    ContentCluster cr = createCluster(getSimpleDispatchXml() + getMaxhitsTuning());
    IndexedSearchCluster ix = cr.getSearch().getIndexed();
    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));
    assertThat(config.dataset(0).maxhitspernode(), is(300));
    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));
        assertThat(c.dataset(0).maxhitspernode(), is(100));
    }
}
Also used : PartitionsConfig(com.yahoo.vespa.config.search.core.PartitionsConfig) 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