use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureMmapNoCoreLimit.
@Test
public void canConfigureMmapNoCoreLimit() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group mmap-core-limit=\"200000\">" + " <node hostalias=\"mockhost\" distribution-key=\"0\" />" + " <node hostalias=\"mockhost\" distribution-key=\"1\" />" + " </group>" + "</content>");
ContentSearchCluster s;
s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(2, b.getStorageNodes().getChildren().size());
assertTrue(b.getRootGroup().getMmapNoCoreLimit().isPresent());
assertEquals(200000, b.getRootGroup().getMmapNoCoreLimit().get().longValue());
assertThat(s.getSearchNodes().size(), is(2));
assertEquals(200000, s.getSearchNodes().get(0).getMMapNoCoreLimit());
assertEquals(200000, s.getSearchNodes().get(1).getMMapNoCoreLimit());
assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(0).getMMapNoCoreEnvVariable());
assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(1).getMMapNoCoreEnvVariable());
}
use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method handleSingleNonSearchPersistentVds.
@Test
public void handleSingleNonSearchPersistentVds() throws Exception {
ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + " <redundancy>3</redundancy>" + " <documents>" + " <document type=\"music\" mode=\"store-only\"/>" + " </documents>" + " <engine>" + " <vds/>" + " </engine>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " </group>" + "</content>");
ContentSearchCluster s = a.getSearch();
assertFalse(s.hasIndexedCluster());
assertTrue(s.getClusters().isEmpty());
assertTrue(a.getPersistence() instanceof VDSEngine.Factory);
assertEquals(1, a.getStorageNodes().getChildren().size());
}
use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method handleSingleNonSearchPersistentDummy.
@Test
public void handleSingleNonSearchPersistentDummy() throws Exception {
ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + " <redundancy>3</redundancy>" + " <documents>" + " <document type=\"music\" mode=\"store-only\"/>" + " </documents>" + " <engine>" + " <dummy/>" + " </engine>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " </group>" + "</content>");
ContentSearchCluster s = a.getSearch();
assertFalse(s.hasIndexedCluster());
assertTrue(s.getClusters().isEmpty());
assertTrue(a.getPersistence() instanceof com.yahoo.vespa.model.content.engines.DummyPersistence.Factory);
}
use of com.yahoo.vespa.model.content.ContentSearchCluster 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.model.content.ContentSearchCluster 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());
}
Aggregations