Search in sources :

Example 6 with ContentSearchCluster

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

the class ContentBuilderTest method canConfigureMmapNoCoreLimit.

@Test
public void canConfigureMmapNoCoreLimit() throws Exception {
    ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + "    <redundancy>2</redundancy>" + "      <documents>" + "        <document type='music' mode='index'/>" + "      </documents>" + "    <group mmap-core-limit=\"200000\">" + "      <node hostalias=\"mockhost\" distribution-key=\"0\" />" + "      <node hostalias=\"mockhost\" distribution-key=\"1\" />" + "    </group>" + "</content>");
    ContentSearchCluster s;
    s = b.getSearch();
    assertTrue(s.hasIndexedCluster());
    assertNotNull(s.getIndexed());
    assertEquals(2, b.getStorageNodes().getChildren().size());
    assertTrue(b.getRootGroup().getMmapNoCoreLimit().isPresent());
    assertEquals(200000, b.getRootGroup().getMmapNoCoreLimit().get().longValue());
    assertThat(s.getSearchNodes().size(), is(2));
    assertEquals(200000, s.getSearchNodes().get(0).getMMapNoCoreLimit());
    assertEquals(200000, s.getSearchNodes().get(1).getMMapNoCoreLimit());
    assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(0).getMMapNoCoreEnvVariable());
    assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(1).getMMapNoCoreEnvVariable());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 7 with ContentSearchCluster

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

the class ContentBuilderTest method handleSingleNonSearchPersistentVds.

@Test
public void handleSingleNonSearchPersistentVds() throws Exception {
    ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + "    <redundancy>3</redundancy>" + "    <documents>" + "       <document type=\"music\" mode=\"store-only\"/>" + "    </documents>" + "    <engine>" + "      <vds/>" + "    </engine>" + "    <group>" + "      <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + "    </group>" + "</content>");
    ContentSearchCluster s = a.getSearch();
    assertFalse(s.hasIndexedCluster());
    assertTrue(s.getClusters().isEmpty());
    assertTrue(a.getPersistence() instanceof VDSEngine.Factory);
    assertEquals(1, a.getStorageNodes().getChildren().size());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) VDSEngine(com.yahoo.vespa.model.content.engines.VDSEngine) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 8 with ContentSearchCluster

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

the class ContentBuilderTest method handleSingleNonSearchPersistentDummy.

@Test
public void handleSingleNonSearchPersistentDummy() throws Exception {
    ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + "    <redundancy>3</redundancy>" + "    <documents>" + "       <document type=\"music\" mode=\"store-only\"/>" + "    </documents>" + "    <engine>" + "      <dummy/>" + "    </engine>" + "    <group>" + "      <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + "    </group>" + "</content>");
    ContentSearchCluster s = a.getSearch();
    assertFalse(s.hasIndexedCluster());
    assertTrue(s.getClusters().isEmpty());
    assertTrue(a.getPersistence() instanceof com.yahoo.vespa.model.content.engines.DummyPersistence.Factory);
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 9 with ContentSearchCluster

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

the class DocumentDatabaseTestCase method assertAttributesConfigIndependentOfMode.

private void assertAttributesConfigIndependentOfMode(String mode, List<String> sds, List<String> documentDBConfigIds, Map<String, List<String>> expectedAttributesMap) {
    VespaModel model = new VespaModelCreatorWithMockPkg(vespaHosts, createVespaServices(sds, mode), ApplicationPackageUtils.generateSearchDefinitions(sds)).create();
    ContentSearchCluster contentSearchCluster = model.getContentClusters().get("test").getSearch();
    ProtonConfig proton = getProtonCfg(contentSearchCluster);
    assertEquals(sds.size(), proton.documentdb().size());
    for (int i = 0; i < sds.size(); i++) {
        assertEquals(sds.get(i), proton.documentdb(i).inputdoctypename());
        assertEquals(documentDBConfigIds.get(i), proton.documentdb(i).configid());
        List<String> expectedAttributes = expectedAttributesMap.get(sds.get(i));
        if (expectedAttributes != null) {
            AttributesConfig rac1 = model.getConfig(AttributesConfig.class, proton.documentdb(i).configid());
            assertEquals(expectedAttributes.size(), rac1.attribute().size());
            for (int j = 0; j < expectedAttributes.size(); j++) {
                assertEquals(expectedAttributes.get(j), rac1.attribute(j).name());
            }
        }
    }
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) VespaModelCreatorWithMockPkg(com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg) VespaModel(com.yahoo.vespa.model.VespaModel) AttributesConfig(com.yahoo.vespa.config.search.AttributesConfig)

Example 10 with ContentSearchCluster

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

the class ModelProvisioningTest method require_that_config_override_and_explicit_proton_tuning_have_precedence_over_default_node_flavor_tuning.

@Test
public void require_that_config_override_and_explicit_proton_tuning_have_precedence_over_default_node_flavor_tuning() {
    String services = joinLines("<?xml version='1.0' encoding='utf-8' ?>", "<services>", "  <content version='1.0' id='test'>", "    <config name='vespa.config.search.core.proton'>", "      <flush><memory><maxtlssize>2000</maxtlssize></memory></flush>", "    </config>", "    <documents>", "      <document type='type1' mode='index'/>", "    </documents>", "    <nodes count='1' flavor='content-test-flavor'/>", "    <engine>", "      <proton>", "        <tuning>", "          <searchnode>", "            <flushstrategy>", "              <native>", "                <total>", "                  <maxmemorygain>1000</maxmemorygain>", "                </total>", "              </native>", "            </flushstrategy>", "          </searchnode>", "        </tuning>", "      </proton>", "    </engine>", "  </content>", "</services>");
    VespaModelTester tester = new VespaModelTester();
    tester.addHosts("default", 1);
    tester.addHosts(createFlavorFromMemoryAndDisk("content-test-flavor", 128, 100), 1);
    VespaModel model = tester.createModel(services, true, 0);
    ContentSearchCluster cluster = model.getContentClusters().get("test").getSearch();
    ProtonConfig cfg = getProtonConfig(model, cluster.getSearchNodes().get(0).getConfigId());
    // from config override
    assertEquals(2000, cfg.flush().memory().maxtlssize());
    // from explicit tuning
    assertEquals(1000, cfg.flush().memory().maxmemory());
    // from default node flavor tuning
    assertEquals((long) 16 * GB, cfg.flush().memory().each().maxmemory());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) VespaModelTester(com.yahoo.vespa.model.test.VespaModelTester) VespaModel(com.yahoo.vespa.model.VespaModel) Test(org.junit.Test)

Aggregations

ContentSearchCluster (com.yahoo.vespa.model.content.ContentSearchCluster)22 Test (org.junit.Test)20 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)17 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)17 VespaModel (com.yahoo.vespa.model.VespaModel)6 ProtonConfig (com.yahoo.vespa.config.search.core.ProtonConfig)4 VDSEngine (com.yahoo.vespa.model.content.engines.VDSEngine)4 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)4 HostResource (com.yahoo.vespa.model.HostResource)3 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 AttributesConfig (com.yahoo.vespa.config.search.AttributesConfig)2 IndexedSearchCluster (com.yahoo.vespa.model.search.IndexedSearchCluster)2 VespaModelTester (com.yahoo.vespa.model.test.VespaModelTester)2 IndexInfoConfig (com.yahoo.search.config.IndexInfoConfig)1 PartitionsConfig (com.yahoo.vespa.config.search.core.PartitionsConfig)1 IlscriptsConfig (com.yahoo.vespa.configdefinition.IlscriptsConfig)1