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());
}
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());
}
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());
}
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);
}
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);
}
Aggregations