Search in sources :

Example 11 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class NodeFlavorTuningTest method require_that_hwinfo_disk_size_is_set.

@Test
public void require_that_hwinfo_disk_size_is_set() {
    ProtonConfig cfg = configFromDiskSetting(100);
    assertEquals(100 * GB, cfg.hwinfo().disk().size());
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Test(org.junit.Test)

Example 12 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig 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 13 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig 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)

Example 14 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class DomSearchTuningBuilderTest method getProtonCfg.

String getProtonCfg(Tuning tuning) {
    ProtonConfig.Builder pb = new ProtonConfig.Builder();
    tuning.getConfig(pb);
    return StringUtilities.implode(ConfigInstance.serialize(new ProtonConfig(pb)).toArray(new String[0]), "\n");
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Matchers.containsString(org.hamcrest.Matchers.containsString)

Example 15 with ProtonConfig

use of com.yahoo.vespa.config.search.core.ProtonConfig in project vespa by vespa-engine.

the class ClusterTest method requireThatContentSearchIsApplied.

@Test
public void requireThatContentSearchIsApplied() throws ParseException {
    ContentCluster cluster = newContentCluster(joinLines("<search>", "  <query-timeout>1.1</query-timeout>", "  <visibility-delay>2.3</visibility-delay>", "</search>"));
    IndexedSearchCluster searchCluster = cluster.getSearch().getIndexed();
    assertNotNull(searchCluster);
    assertEquals(1.1, searchCluster.getQueryTimeout(), 1E-6);
    assertEquals(2.3, searchCluster.getVisibilityDelay(), 1E-6);
    ProtonConfig proton = getProtonConfig(cluster);
    assertEquals(searchCluster.getVisibilityDelay(), proton.documentdb(0).visibilitydelay(), 1E-6);
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) IndexedSearchCluster(com.yahoo.vespa.model.search.IndexedSearchCluster) Test(org.junit.Test)

Aggregations

ProtonConfig (com.yahoo.vespa.config.search.core.ProtonConfig)23 Test (org.junit.Test)16 VespaModel (com.yahoo.vespa.model.VespaModel)5 ContentSearchCluster (com.yahoo.vespa.model.content.ContentSearchCluster)4 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)4 VespaModelCreatorWithMockPkg (com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg)4 IndexedSearchCluster (com.yahoo.vespa.model.search.IndexedSearchCluster)3 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)2 ConfigPayloadBuilder (com.yahoo.vespa.config.ConfigPayloadBuilder)2 StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)2 AttributesConfig (com.yahoo.vespa.config.search.AttributesConfig)2 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)2 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Flavor (com.yahoo.config.provision.Flavor)1 IndexInfoConfig (com.yahoo.search.config.IndexInfoConfig)1 IlscriptsConfig (com.yahoo.vespa.configdefinition.IlscriptsConfig)1 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)1 VespaModelTester (com.yahoo.vespa.model.test.VespaModelTester)1 Ignore (org.junit.Ignore)1