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