Search in sources :

Example 16 with ProtonConfig

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

the class ClusterTest method testHierarchicRedundancy.

@Test
public void testHierarchicRedundancy() {
    ContentCluster cc = parse("" + "<content version=\"1.0\" id=\"storage\">\n" + "  <documents/>" + "  <engine>" + "    <proton>" + "      <searchable-copies>3</searchable-copies>" + "    </proton>" + "  </engine>" + "  <redundancy>15</redundancy>\n" + "  <group name='root' distribution-key='0'>" + "    <distribution partitions='1|1|*'/>" + "    <group name='g-1' distribution-key='0'>" + "      <node hostalias='mockhost' distribution-key='0'/>" + "      <node hostalias='mockhost' distribution-key='1'/>" + "      <node hostalias='mockhost' distribution-key='2'/>" + "      <node hostalias='mockhost' distribution-key='3'/>" + "      <node hostalias='mockhost' distribution-key='4'/>" + "    </group>" + "    <group name='g-2' distribution-key='1'>" + "      <node hostalias='mockhost' distribution-key='5'/>" + "      <node hostalias='mockhost' distribution-key='6'/>" + "      <node hostalias='mockhost' distribution-key='7'/>" + "      <node hostalias='mockhost' distribution-key='8'/>" + "      <node hostalias='mockhost' distribution-key='9'/>" + "    </group>" + "    <group name='g-3' distribution-key='1'>" + "      <node hostalias='mockhost' distribution-key='10'/>" + "      <node hostalias='mockhost' distribution-key='11'/>" + "      <node hostalias='mockhost' distribution-key='12'/>" + "      <node hostalias='mockhost' distribution-key='13'/>" + "      <node hostalias='mockhost' distribution-key='14'/>" + "    </group>" + "  </group>" + "</content>");
    StorDistributionConfig.Builder storBuilder = new StorDistributionConfig.Builder();
    cc.getConfig(storBuilder);
    StorDistributionConfig storConfig = new StorDistributionConfig(storBuilder);
    assertEquals(15, storConfig.initial_redundancy());
    assertEquals(15, storConfig.redundancy());
    assertEquals(3, storConfig.ready_copies());
    ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder();
    cc.getSearch().getConfig(protonBuilder);
    ProtonConfig protonConfig = new ProtonConfig(protonBuilder);
    assertEquals(1, protonConfig.distribution().searchablecopies());
    assertEquals(5, protonConfig.distribution().redundancy());
}
Also used : StorDistributionConfig(com.yahoo.vespa.config.content.StorDistributionConfig) ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 17 with ProtonConfig

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

the class ClusterTest method testRedundancy.

@Test
public void testRedundancy() {
    ContentCluster cc = parse("" + "<content version=\"1.0\" id=\"storage\">\n" + "  <documents/>" + "  <engine>" + "    <proton>" + "      <searchable-copies>3</searchable-copies>" + "    </proton>" + "  </engine>" + "  <redundancy reply-after='4'>5</redundancy>\n" + "  <group>" + "    <node hostalias='mockhost' distribution-key='0'/>" + "    <node hostalias='mockhost' distribution-key='1'/>" + "    <node hostalias='mockhost' distribution-key='2'/>" + "    <node hostalias='mockhost' distribution-key='3'/>" + "    <node hostalias='mockhost' distribution-key='4'/>" + "  </group>" + "</content>");
    StorDistributionConfig.Builder storBuilder = new StorDistributionConfig.Builder();
    cc.getConfig(storBuilder);
    StorDistributionConfig storConfig = new StorDistributionConfig(storBuilder);
    assertEquals(4, storConfig.initial_redundancy());
    assertEquals(5, storConfig.redundancy());
    assertEquals(3, storConfig.ready_copies());
    ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder();
    cc.getSearch().getConfig(protonBuilder);
    ProtonConfig protonConfig = new ProtonConfig(protonBuilder);
    assertEquals(3, protonConfig.distribution().searchablecopies());
    assertEquals(5, protonConfig.distribution().redundancy());
}
Also used : StorDistributionConfig(com.yahoo.vespa.config.content.StorDistributionConfig) ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 18 with ProtonConfig

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

the class NodeFlavorTuningTest method require_that_hwinfo_memory_size_is_set.

@Test
public void require_that_hwinfo_memory_size_is_set() {
    ProtonConfig cfg = configFromMemorySetting(24);
    assertEquals(24 * GB, cfg.hwinfo().memory().size());
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Test(org.junit.Test)

Example 19 with ProtonConfig

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

the class NodeFlavorTuningTest method require_that_slow_disk_is_reflected_in_proton_config.

@Test
public void require_that_slow_disk_is_reflected_in_proton_config() {
    ProtonConfig cfg = configFromDiskSetting(false);
    assertEquals(40, 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)

Example 20 with ProtonConfig

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

the class NodeFlavorTuningTest method getConfig.

private static ProtonConfig getConfig(FlavorsConfig.Flavor.Builder flavorBuilder) {
    flavorBuilder.name("my_flavor");
    NodeFlavorTuning tuning = new NodeFlavorTuning(new Flavor(new FlavorsConfig.Flavor(flavorBuilder)));
    ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder();
    tuning.getConfig(protonBuilder);
    return new ProtonConfig(protonBuilder);
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) Flavor(com.yahoo.config.provision.Flavor)

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