Search in sources :

Example 56 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster 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());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 57 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster 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());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) VDSEngine(com.yahoo.vespa.model.content.engines.VDSEngine) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 58 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster 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());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 59 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster 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());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 60 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster 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());
    }
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Aggregations

ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)83 Test (org.junit.Test)70 VespaModel (com.yahoo.vespa.model.VespaModel)22 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)20 ContentSearchCluster (com.yahoo.vespa.model.content.ContentSearchCluster)18 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)16 VespaModelTester (com.yahoo.vespa.model.test.VespaModelTester)15 MockRoot (com.yahoo.config.model.test.MockRoot)7 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)7 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)6 PartitionsConfig (com.yahoo.vespa.config.search.core.PartitionsConfig)5 HostResource (com.yahoo.vespa.model.HostResource)5 SearchNode (com.yahoo.vespa.model.search.SearchNode)5 Matchers.containsString (org.hamcrest.Matchers.containsString)5 StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)4 ProtonConfig (com.yahoo.vespa.config.search.core.ProtonConfig)4 ProtonEngine (com.yahoo.vespa.model.content.engines.ProtonEngine)4 VDSEngine (com.yahoo.vespa.model.content.engines.VDSEngine)4 StorServerConfig (com.yahoo.vespa.config.content.core.StorServerConfig)3 ConfigChangeAction (com.yahoo.config.model.api.ConfigChangeAction)2