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);
}
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());
}
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());
}
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());
}
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());
}
Aggregations