Search in sources :

Example 6 with ProtonConfig

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

the class ContentBuilderTest method ensureOverrideAppendedOnlyOnce.

@Test
@Ignore
public void ensureOverrideAppendedOnlyOnce() throws Exception {
    ContentCluster content = createContent("<content version='1.0' id='search'>" + "  <config name=\"vespa.config.search.core.proton\">" + "    <numthreadspersearch>1</numthreadspersearch>" + "    <search>" + "      <mmap>" + "        <options><item>POPULATE</item></options>" + "      </mmap>" + "    </search>" + "  </config>" + "  <redundancy>2</redundancy>" + "  <documents>" + "    <document type='music' mode='index'/>" + "  </documents>" + "  <group>" + "    <node hostalias='mockhost' distribution-key='0'/>" + "  </group>" + "</content>");
    ProtonConfig.Builder builder = new ProtonConfig.Builder();
    content.getSearch().getIndexed().getSearchNode(0).cascadeConfig(builder);
    content.getSearch().getIndexed().getSearchNode(0).addUserConfig(builder);
    ProtonConfig config = new ProtonConfig(builder);
    assertThat(config.search().mmap().options().size(), is(1));
    assertThat(config.search().mmap().options(0), is(ProtonConfig.Search.Mmap.Options.POPULATE));
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) ConfigPayloadBuilder(com.yahoo.vespa.config.ConfigPayloadBuilder) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Ignore(org.junit.Ignore) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 7 with ProtonConfig

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

the class ClusterTest method requireThatVisibilityDelayIsZeroForGlobalDocumentType.

@Test
public void requireThatVisibilityDelayIsZeroForGlobalDocumentType() throws ParseException {
    ContentCluster cluster = newContentCluster(joinLines("<search>", "  <visibility-delay>2.3</visibility-delay>", "</search>"), true);
    ProtonConfig proton = getProtonConfig(cluster);
    assertEquals(0.0, proton.documentdb(0).visibilitydelay(), 1E-6);
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Test(org.junit.Test)

Example 8 with ProtonConfig

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

the class IndexedTest method testMixedIndexAndStoreOnly.

@Test
public void testMixedIndexAndStoreOnly() {
    String services = "<services version='1.0'>" + "  <admin version='2.0'><adminserver hostalias='node0' /></admin>" + "  <content id='docstore' version=\"1.0\">" + "    <redundancy>1</redundancy>" + "    <documents>" + "      <document type=\"index_me\" mode=\"index\"/>" + "      <document type=\"store_me\" mode=\"store-only\"/>" + "    </documents>" + "    <group>" + "      <node distribution-key=\"0\" hostalias=\"node0\"/>" + "    </group>" + "  </content>" + "</services>";
    List<String> sds = ApplicationPackageUtils.generateSearchDefinitions("index_me", "store_me");
    VespaModel model = new VespaModelCreatorWithMockPkg(getHosts(), services, sds).create();
    ProtonConfig.Builder pb = new ProtonConfig.Builder();
    model.getConfig(pb, "docstore/search/cluster.docstore/0");
    ProtonConfig protonConfig = new ProtonConfig(pb);
    assertEquals(2, protonConfig.documentdb().size());
    assertEquals("index_me", protonConfig.documentdb(0).inputdoctypename());
    assertEquals("docstore/search/cluster.docstore/index_me", protonConfig.documentdb(0).configid());
    assertEquals("store_me", protonConfig.documentdb(1).inputdoctypename());
    assertEquals("docstore/search", protonConfig.documentdb(1).configid());
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) VespaModelCreatorWithMockPkg(com.yahoo.vespa.model.test.utils.VespaModelCreatorWithMockPkg) VespaModel(com.yahoo.vespa.model.VespaModel) Test(org.junit.Test)

Example 9 with ProtonConfig

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

the class NodeFlavorTuningTest method require_that_hwinfo_cpu_cores_is_set.

@Test
public void require_that_hwinfo_cpu_cores_is_set() {
    ProtonConfig cfg = configFromNumCoresSetting(24);
    assertEquals(24, cfg.hwinfo().cpu().cores());
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Test(org.junit.Test)

Example 10 with ProtonConfig

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

the class NodeFlavorTuningTest method require_that_fast_disk_is_reflected_in_proton_config.

@Test
public void require_that_fast_disk_is_reflected_in_proton_config() {
    ProtonConfig cfg = configFromDiskSetting(true);
    assertEquals(200, cfg.hwinfo().disk().writespeed(), 0.001);
    assertEquals(100, cfg.hwinfo().disk().slowwritespeedlimit(), 0.001);
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) 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