Search in sources :

Example 71 with ContentCluster

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

the class DistributorTest method testMaxMergesPerNode.

@Test
public void testMaxMergesPerNode() {
    StorDistributormanagerConfig.Builder builder = new StorDistributormanagerConfig.Builder();
    DistributorCluster dcluster = parse("<content id=\"storage\">\n" + "  <documents/>" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</content>");
    ((ContentCluster) dcluster.getParent()).getConfig(builder);
    StorDistributormanagerConfig conf = new StorDistributormanagerConfig(builder);
    assertEquals(16, conf.maximum_nodes_per_merge());
    builder = new StorDistributormanagerConfig.Builder();
    dcluster = parse("<content id=\"storage\">\n" + "  <documents/>" + "  <tuning>\n" + "    <merges max-nodes-per-merge=\"4\"/>\n" + "  </tuning>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "  </group>" + "</content>");
    ((ContentCluster) dcluster.getParent()).getConfig(builder);
    conf = new StorDistributormanagerConfig(builder);
    assertEquals(4, conf.maximum_nodes_per_merge());
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 72 with ContentCluster

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

the class IndexedHierarchicDistributionTest method requireThatLeafGroupsCanHaveUnequalNumberOfNodesIfRandomPolicy.

@Test
public void requireThatLeafGroupsCanHaveUnequalNumberOfNodesIfRandomPolicy() throws Exception {
    ContentCluster c = getOddGroupsCluster();
    DispatchGroup dg = c.getSearch().getIndexed().getRootDispatch();
    assertEquals(8, dg.getRowBits());
    assertEquals(3, dg.getNumPartitions());
    assertEquals(true, dg.useFixedRowInDispatch());
    assertEquals(1, dg.getMaxNodesDownPerFixedRow());
    ArrayList<SearchInterface> list = new ArrayList<>();
    for (SearchInterface si : dg.getSearchersIterable()) {
        list.add(si);
    }
    assertEquals(5, list.size());
    assertEquals(0, list.get(0).getNodeSpec().partitionId());
    assertEquals(0, list.get(0).getNodeSpec().groupIndex());
    assertEquals(0, list.get(1).getNodeSpec().partitionId());
    assertEquals(1, list.get(1).getNodeSpec().groupIndex());
    assertEquals(1, list.get(2).getNodeSpec().partitionId());
    assertEquals(0, list.get(2).getNodeSpec().groupIndex());
    assertEquals(1, list.get(3).getNodeSpec().partitionId());
    assertEquals(1, list.get(3).getNodeSpec().groupIndex());
    assertEquals(2, list.get(4).getNodeSpec().partitionId());
    assertEquals(1, list.get(4).getNodeSpec().groupIndex());
}
Also used : SearchInterface(com.yahoo.vespa.model.search.SearchInterface) DispatchGroup(com.yahoo.vespa.model.search.DispatchGroup) ArrayList(java.util.ArrayList) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 73 with ContentCluster

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

the class IndexedHierarchicDistributionTest method requireThatActivePerLeafGroupIsSetWithTwoGroups.

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

Example 74 with ContentCluster

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

the class IndexedHierarchicDistributionTest method requireThatDispatcherIsCorrectWithTwoGroups.

@Test
public void requireThatDispatcherIsCorrectWithTwoGroups() throws Exception {
    ContentCluster c = getTwoGroupsCluster();
    PartitionsConfig.Dataset dataset = getDataset(c.getSearch().getIndexed().getTLDs().get(0));
    assertEquals(3, dataset.numparts());
    assertEquals(2, dataset.maxnodesdownperfixedrow());
    assertEquals(PartitionsConfig.Dataset.Querydistribution.FIXEDROW, dataset.querydistribution());
    List<PartitionsConfig.Dataset.Engine> engines = dataset.engine();
    assertEquals(6, engines.size());
    assertEngine(0, 0, engines.get(0));
    assertEngine(1, 0, engines.get(1));
    assertEngine(0, 1, engines.get(2));
    assertEngine(1, 1, engines.get(3));
    assertEngine(0, 2, engines.get(4));
    assertEngine(1, 2, engines.get(5));
}
Also used : PartitionsConfig(com.yahoo.vespa.config.search.core.PartitionsConfig) DispatchUtils.assertEngine(com.yahoo.vespa.model.search.utils.DispatchUtils.assertEngine) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 75 with ContentCluster

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

the class IndexedHierarchicDistributionTest method requireThatSearchNodesAreCorrectWithOneGroup.

@Test
public void requireThatSearchNodesAreCorrectWithOneGroup() throws Exception {
    ContentCluster c = getOneGroupCluster();
    List<SearchNode> searchNodes = c.getSearch().getSearchNodes();
    assertEquals(3, searchNodes.size());
    assertSearchNode(0, 0, 0, searchNodes.get(0));
    assertSearchNode(0, 1, 1, searchNodes.get(1));
    assertSearchNode(0, 2, 2, searchNodes.get(2));
}
Also used : SearchNode(com.yahoo.vespa.model.search.SearchNode) 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