Search in sources :

Example 16 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class ClusterTest method testImplicitDistributionBits.

@Test
public void testImplicitDistributionBits() {
    ContentCluster cluster = parse("<content version=\"1.0\" id=\"storage\">\n" + "  <documents/>" + "  <group>\n" + "    <node distribution-key=\"0\" hostalias=\"mockhost\"/>\n" + "  </group>\n" + "</content>");
    assertDistributionBitsInConfig(cluster, 8);
    cluster = parse("<content version=\"1.0\" id=\"storage\">\n" + "  <documents/>" + "  <engine>" + "    <vds/>" + "  </engine>" + "  <group>\n" + "    <node distribution-key=\"0\" hostalias=\"mockhost\"/>\n" + "  </group>\n" + "</content>");
    assertDistributionBitsInConfig(cluster, 8);
}
Also used : ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 17 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class ClusterTest method getFleetControllerConfig.

FleetcontrollerConfig getFleetControllerConfig(String xml) {
    ContentCluster cluster = parse(xml);
    FleetcontrollerConfig.Builder builder = new FleetcontrollerConfig.Builder();
    cluster.getConfig(builder);
    cluster.getClusterControllerConfig().getConfig(builder);
    return new FleetcontrollerConfig(builder);
}
Also used : SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) FleetcontrollerConfig(com.yahoo.vespa.config.content.FleetcontrollerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster)

Example 18 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class ContentBuilderTest method requireOneTldPerSearchContainer.

@Test
public void requireOneTldPerSearchContainer() throws Exception {
    ContentCluster content = createContent("  <content version='1.0' id='storage'>\n" + "    <redundancy>1</redundancy>\n" + "    <documents>" + "       <document type='music' mode='index'/>" + "    </documents>" + "    <group>\n" + "      <node hostalias='mockhost' distribution-key='0' />\n" + "    </group>\n" + "  </content>\n" + "  <jdisc version='1.0' id='qrc'>" + "      <search/>" + "      <nodes>" + "        <node hostalias='mockhost' />" + "      </nodes>" + "  </jdisc>" + "  <jdisc version='1.0' id='qrc2'>" + "      <http>" + "      <server id ='server1' port='5000' />" + "      </http>" + "      <search/>" + "      <nodes>" + "        <node hostalias='mockhost' />" + "        <node hostalias='mockhost2' />" + "      </nodes>" + "  </jdisc>");
    List<Dispatch> tlds = content.getSearch().getIndexed().getTLDs();
    assertThat(tlds.get(0).getHostname(), is("node0"));
    assertThat(tlds.get(1).getHostname(), is("node0"));
    assertThat(tlds.get(2).getHostname(), is("node1"));
    assertThat(tlds.size(), is(3));
}
Also used : ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 19 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class ContentBuilderTest method handleProtonTuning.

@Test
public void handleProtonTuning() throws Exception {
    ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + "    <redundancy>3</redundancy>" + "    <engine>" + "      <proton>" + "        <tuning>" + "          <searchnode>" + "            <summary>" + "              <store>" + "                <cache>" + "                  <maxsize>8192</maxsize>" + "                  <compression>" + "                    <type>lz4</type>" + "                    <level>8</level>" + "                  </compression>" + "                </cache>" + "              </store>" + "              <io>" + "                <read>directio</read>" + "              </io>" + "            </summary>" + "          </searchnode>" + "        </tuning>" + "      </proton>" + "    </engine>" + "    <documents>" + "       <document type='music' mode='index'/>" + "    </documents>" + "    <group>" + "      <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + "    </group>" + "</content>");
    assertTrue(a.getPersistence() instanceof ProtonEngine.Factory);
    ProtonConfig.Builder pb = new ProtonConfig.Builder();
    a.getSearch().getConfig(pb);
    List<String> serialize = ConfigInstance.serialize(new ProtonConfig(pb));
    String cfg = StringUtilities.implode(serialize.toArray(new String[serialize.size()]), "\n");
    assertThat(cfg, containsString("summary.cache.maxbytes 8192"));
    assertThat(cfg, containsString("summary.cache.compression.level 8"));
    assertThat(cfg, containsString("summary.cache.compression.type LZ4"));
    assertThat(cfg, containsString("summary.read.io DIRECTIO"));
}
Also used : ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) ConfigPayloadBuilder(com.yahoo.vespa.config.ConfigPayloadBuilder) ProtonEngine(com.yahoo.vespa.model.content.engines.ProtonEngine) Matchers.containsString(org.hamcrest.Matchers.containsString) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 20 with ContentCluster

use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.

the class ContentBuilderTest method handleIndexedWithoutPersistence.

@Test
public void handleIndexedWithoutPersistence() throws Exception {
    ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + "    <redundancy>3</redundancy>" + "      <documents>" + "        <document type='music' mode='index'/>" + "      </documents>" + "    <group>" + "      <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + "    </group>" + "</content>");
    ContentSearchCluster s;
    s = b.getSearch();
    assertTrue(s.hasIndexedCluster());
    assertEquals(1, s.getClusters().size());
    assertNotNull(s.getIndexed());
    assertEquals("b", s.getIndexed().getClusterName());
    assertTrue(b.getPersistence() instanceof ProtonEngine.Factory);
    assertEquals(1, b.getStorageNodes().getChildren().size());
    assertEquals("b", b.getConfigId());
    // assertEquals("content/a/0", a.getRootGroup().getNodes().get(0).getConfigId());
    // Due to reuse.
    assertEquals("b/storage/0", b.getRootGroup().getNodes().get(0).getConfigId());
    assertEquals(1, b.getRoot().getHostSystem().getHosts().size());
    HostResource h = b.getRoot().getHostSystem().getHost("mockhost");
    assertEquals("b/storage/0", h.getService("storagenode").getConfigId());
}
Also used : ContentSearchCluster(com.yahoo.vespa.model.content.ContentSearchCluster) HostResource(com.yahoo.vespa.model.HostResource) ProtonEngine(com.yahoo.vespa.model.content.engines.ProtonEngine) 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