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