use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureMmapNoCoreLimitPerHost.
@Test
public void canConfigureMmapNoCoreLimitPerHost() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\" mmap-core-limit=\"200000\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"1\" />" + " </group>" + "</content>");
ContentSearchCluster s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(2, b.getStorageNodes().getChildren().size());
assertFalse(b.getRootGroup().getMmapNoCoreLimit().isPresent());
assertThat(s.getSearchNodes().size(), is(2));
assertEquals(200000, s.getSearchNodes().get(0).getMMapNoCoreLimit());
assertEquals(-1, s.getSearchNodes().get(1).getMMapNoCoreLimit());
assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(0).getMMapNoCoreEnvVariable());
assertEquals("", s.getSearchNodes().get(1).getMMapNoCoreEnvVariable());
}
use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method handleSingleNonSearchNonPersistentCluster.
@Test
public void handleSingleNonSearchNonPersistentCluster() 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());
assertNull(s.getIndexed());
assertNull(a.getRootGroup().getName());
assertNull(a.getRootGroup().getIndex());
assertTrue(a.getRootGroup().getSubgroups().isEmpty());
assertEquals(1, a.getRootGroup().getNodes().size());
assertEquals("node0", a.getRootGroup().getNodes().get(0).getHostName());
assertTrue(a.getPersistence() instanceof VDSEngine.Factory);
assertEquals(1, a.getStorageNodes().getChildren().size());
assertEquals("a", a.getConfigId());
}
use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureCoreOnOOMPerHost.
@Test
public void canConfigureCoreOnOOMPerHost() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\" core-on-oom=\"true\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"1\" core-on-oom=\"false\"/>" + " </group>" + "</content>");
ContentSearchCluster s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(2, b.getStorageNodes().getChildren().size());
assertFalse(b.getRootGroup().getCoreOnOOM().isPresent());
assertThat(s.getSearchNodes().size(), is(2));
assertTrue(s.getSearchNodes().get(0).getCoreOnOOM());
assertFalse(s.getSearchNodes().get(1).getCoreOnOOM());
assertEquals("", s.getSearchNodes().get(0).getCoreOnOOMEnvVariable());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true ", s.getSearchNodes().get(1).getCoreOnOOMEnvVariable());
}
use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureCoreOnOOM.
@Test
public void canConfigureCoreOnOOM() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group core-on-oom=\"true\">" + " <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().getCoreOnOOM().isPresent());
assertTrue(b.getRootGroup().getCoreOnOOM().get());
assertThat(s.getSearchNodes().size(), is(2));
assertTrue(s.getSearchNodes().get(0).getCoreOnOOM());
assertTrue(s.getSearchNodes().get(1).getCoreOnOOM());
assertEquals("", s.getSearchNodes().get(0).getCoreOnOOMEnvVariable());
assertEquals("", s.getSearchNodes().get(1).getCoreOnOOMEnvVariable());
}
use of com.yahoo.vespa.model.content.ContentSearchCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureVespaMalloc.
@Test
public void canConfigureVespaMalloc() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group no-vespamalloc=\"proton\" vespamalloc-debug=\"distributord\" vespamalloc-debug-stacktrace=\"all\" vespamalloc=\"storaged\">" + " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"1\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"2\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"3\"/>" + " </group>" + "</content>");
ContentSearchCluster s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(4, b.getStorageNodes().getChildren().size());
assertTrue(b.getRootGroup().getNoVespaMalloc().isPresent());
assertEquals("proton", b.getRootGroup().getNoVespaMalloc().get());
assertTrue(b.getRootGroup().getVespaMalloc().isPresent());
assertEquals("storaged", b.getRootGroup().getVespaMalloc().get());
assertTrue(b.getRootGroup().getVespaMallocDebug().isPresent());
assertEquals("distributord", b.getRootGroup().getVespaMallocDebug().get());
assertTrue(b.getRootGroup().getVespaMallocDebugStackTrace().isPresent());
assertEquals("all", b.getRootGroup().getVespaMallocDebugStackTrace().get());
assertThat(s.getSearchNodes().size(), is(4));
for (SearchNode n : s.getSearchNodes()) {
assertEquals("proton", n.getNoVespaMalloc());
assertEquals("VESPA_USE_NO_VESPAMALLOC=\"proton\" ", n.getNoVespaMallocEnvVariable());
assertEquals("distributord", n.getVespaMallocDebug());
assertEquals("VESPA_USE_VESPAMALLOC=\"storaged\" ", n.getVespaMallocEnvVariable());
assertEquals("all", n.getVespaMallocDebugStackTrace());
assertEquals("VESPA_USE_VESPAMALLOC_D=\"distributord\" ", n.getVespaMallocDebugEnvVariable());
assertEquals("storaged", n.getVespaMalloc());
assertEquals("VESPA_USE_VESPAMALLOC_DST=\"all\" ", n.getVespaMallocDebugStackTraceEnvVariable());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true VESPA_USE_NO_VESPAMALLOC=\"proton\" VESPA_USE_VESPAMALLOC=\"storaged\" VESPA_USE_VESPAMALLOC_D=\"distributord\" VESPA_USE_VESPAMALLOC_DST=\"all\" ", n.getEnvVariables());
}
}
Aggregations