Search in sources :

Example 66 with ContentCluster

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

the class ClusterTest method testZoneDependentDistributionBits.

@Test
public void testZoneDependentDistributionBits() throws Exception {
    String xml = new ContentClusterBuilder().docTypes("test").getXml();
    ContentCluster prodWith16Bits = createWithZone(xml, new Zone(Environment.prod, RegionName.from("us-east-3")));
    assertDistributionBitsInConfig(prodWith16Bits, 16);
    ContentCluster stagingNot16Bits = createWithZone(xml, new Zone(Environment.staging, RegionName.from("us-east-3")));
    assertDistributionBitsInConfig(stagingNot16Bits, 8);
}
Also used : ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) Zone(com.yahoo.config.provision.Zone) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 67 with ContentCluster

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

the class ClusterTest method testHierarchicRedundancy.

@Test
public void testHierarchicRedundancy() {
    ContentCluster cc = parse("" + "<content version=\"1.0\" id=\"storage\">\n" + "  <documents/>" + "  <engine>" + "    <proton>" + "      <searchable-copies>3</searchable-copies>" + "    </proton>" + "  </engine>" + "  <redundancy>15</redundancy>\n" + "  <group name='root' distribution-key='0'>" + "    <distribution partitions='1|1|*'/>" + "    <group name='g-1' distribution-key='0'>" + "      <node hostalias='mockhost' distribution-key='0'/>" + "      <node hostalias='mockhost' distribution-key='1'/>" + "      <node hostalias='mockhost' distribution-key='2'/>" + "      <node hostalias='mockhost' distribution-key='3'/>" + "      <node hostalias='mockhost' distribution-key='4'/>" + "    </group>" + "    <group name='g-2' distribution-key='1'>" + "      <node hostalias='mockhost' distribution-key='5'/>" + "      <node hostalias='mockhost' distribution-key='6'/>" + "      <node hostalias='mockhost' distribution-key='7'/>" + "      <node hostalias='mockhost' distribution-key='8'/>" + "      <node hostalias='mockhost' distribution-key='9'/>" + "    </group>" + "    <group name='g-3' distribution-key='1'>" + "      <node hostalias='mockhost' distribution-key='10'/>" + "      <node hostalias='mockhost' distribution-key='11'/>" + "      <node hostalias='mockhost' distribution-key='12'/>" + "      <node hostalias='mockhost' distribution-key='13'/>" + "      <node hostalias='mockhost' distribution-key='14'/>" + "    </group>" + "  </group>" + "</content>");
    StorDistributionConfig.Builder storBuilder = new StorDistributionConfig.Builder();
    cc.getConfig(storBuilder);
    StorDistributionConfig storConfig = new StorDistributionConfig(storBuilder);
    assertEquals(15, storConfig.initial_redundancy());
    assertEquals(15, storConfig.redundancy());
    assertEquals(3, storConfig.ready_copies());
    ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder();
    cc.getSearch().getConfig(protonBuilder);
    ProtonConfig protonConfig = new ProtonConfig(protonBuilder);
    assertEquals(1, protonConfig.distribution().searchablecopies());
    assertEquals(5, protonConfig.distribution().redundancy());
}
Also used : StorDistributionConfig(com.yahoo.vespa.config.content.StorDistributionConfig) ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 68 with ContentCluster

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

the class ClusterTest method testRedundancy.

@Test
public void testRedundancy() {
    ContentCluster cc = parse("" + "<content version=\"1.0\" id=\"storage\">\n" + "  <documents/>" + "  <engine>" + "    <proton>" + "      <searchable-copies>3</searchable-copies>" + "    </proton>" + "  </engine>" + "  <redundancy reply-after='4'>5</redundancy>\n" + "  <group>" + "    <node hostalias='mockhost' distribution-key='0'/>" + "    <node hostalias='mockhost' distribution-key='1'/>" + "    <node hostalias='mockhost' distribution-key='2'/>" + "    <node hostalias='mockhost' distribution-key='3'/>" + "    <node hostalias='mockhost' distribution-key='4'/>" + "  </group>" + "</content>");
    StorDistributionConfig.Builder storBuilder = new StorDistributionConfig.Builder();
    cc.getConfig(storBuilder);
    StorDistributionConfig storConfig = new StorDistributionConfig(storBuilder);
    assertEquals(4, storConfig.initial_redundancy());
    assertEquals(5, storConfig.redundancy());
    assertEquals(3, storConfig.ready_copies());
    ProtonConfig.Builder protonBuilder = new ProtonConfig.Builder();
    cc.getSearch().getConfig(protonBuilder);
    ProtonConfig protonConfig = new ProtonConfig(protonBuilder);
    assertEquals(3, protonConfig.distribution().searchablecopies());
    assertEquals(5, protonConfig.distribution().redundancy());
}
Also used : StorDistributionConfig(com.yahoo.vespa.config.content.StorDistributionConfig) ProtonConfig(com.yahoo.vespa.config.search.core.ProtonConfig) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder) ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 69 with ContentCluster

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

the class ClusterTest method testNoId.

@Test
public void testNoId() {
    ContentCluster c = parse("<content version=\"1.0\">\n" + "  <redundancy>1</redundancy>\n" + "  <documents/>" + "  <redundancy reply-after=\"4\">5</redundancy>\n" + "  <group>" + "    <node hostalias=\"mockhost\" distribution-key=\"0\"/>\"" + "  </group>" + "</content>");
    assertEquals("content", c.getName());
}
Also used : ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 70 with ContentCluster

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

the class DistributorTest method testThatGroupsAreCountedInWhenComputingSplitBits.

@Test
public void testThatGroupsAreCountedInWhenComputingSplitBits() {
    StorDistributormanagerConfig.Builder builder = new StorDistributormanagerConfig.Builder();
    ContentCluster cluster = parseCluster("<cluster id=\"storage\">\n" + "  <documents/>" + "    <engine>" + "       <vds/>" + "    </engine>" + "    <tuning>" + "      <distribution type=\"legacy\"/>" + "    </tuning>\n" + "  <group>" + "     <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "     <node distribution-key=\"1\" hostalias=\"mockhost\"/>" + "  </group>" + "</cluster>");
    cluster.getConfig(builder);
    StorDistributormanagerConfig conf = new StorDistributormanagerConfig(builder);
    assertEquals(1024, conf.splitcount());
    assertEquals(512, conf.joincount());
    assertEquals(33544432, conf.splitsize());
    assertEquals(16000000, conf.joinsize());
    assertEquals(8, conf.minsplitcount());
    assertEquals(true, conf.inlinebucketsplitting());
    cluster = parseCluster("<cluster id=\"storage\">\n" + "  <documents/>" + "    <engine>" + "       <vds/>" + "    </engine>" + "    <tuning>" + "      <distribution type=\"legacy\"/>" + "    </tuning>\n" + "  <group>" + "    <distribution partitions=\"1|*\"/>" + "    <group name=\"a\" distribution-key=\"0\">" + "       <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + "    </group>" + "    <group name=\"b\" distribution-key=\"1\">" + "       <node distribution-key=\"1\" hostalias=\"mockhost\"/>" + "    </group>" + "  </group>" + "</cluster>");
    cluster.getConfig(builder);
    conf = new StorDistributormanagerConfig(builder);
    assertEquals(1024, conf.splitcount());
    assertEquals(512, conf.joincount());
    assertEquals(33544432, conf.splitsize());
    assertEquals(16000000, conf.joinsize());
    assertEquals(1, conf.minsplitcount());
    assertEquals(true, conf.inlinebucketsplitting());
}
Also used : StorDistributormanagerConfig(com.yahoo.vespa.config.content.core.StorDistributormanagerConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

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