use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureCpuAffinityAutomatically.
@Test
public void canConfigureCpuAffinityAutomatically() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group cpu-socket-affinity=\"true\">" + " <node hostalias=\"mockhost\" distribution-key=\"0\" />" + " <node hostalias=\"mockhost\" distribution-key=\"1\" />" + " <node hostalias=\"mockhost\" distribution-key=\"2\" />" + " <node hostalias=\"mockhost2\" distribution-key=\"3\" />" + " <node hostalias=\"mockhost2\" distribution-key=\"4\" />" + " <node hostalias=\"mockhost3\" distribution-key=\"5\" />" + " </group>" + "</content>");
ContentSearchCluster s;
s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(6, b.getStorageNodes().getChildren().size());
assertTrue(b.getRootGroup().useCpuSocketAffinity());
assertThat(s.getSearchNodes().size(), is(6));
assertTrue(s.getSearchNodes().get(0).getAffinity().isPresent());
assertTrue(s.getSearchNodes().get(1).getAffinity().isPresent());
assertTrue(s.getSearchNodes().get(2).getAffinity().isPresent());
assertTrue(s.getSearchNodes().get(3).getAffinity().isPresent());
assertTrue(s.getSearchNodes().get(4).getAffinity().isPresent());
assertTrue(s.getSearchNodes().get(5).getAffinity().isPresent());
assertThat(s.getSearchNodes().get(0).getAffinity().get().cpuSocket(), is(0));
assertThat(s.getSearchNodes().get(1).getAffinity().get().cpuSocket(), is(1));
assertThat(s.getSearchNodes().get(2).getAffinity().get().cpuSocket(), is(2));
assertThat(s.getSearchNodes().get(3).getAffinity().get().cpuSocket(), is(0));
assertThat(s.getSearchNodes().get(4).getAffinity().get().cpuSocket(), is(1));
assertThat(s.getSearchNodes().get(5).getAffinity().get().cpuSocket(), is(0));
// TODO: Only needed for the search nodes anyway?
assertFalse(b.getStorageNodes().getChildren().get("0").getAffinity().isPresent());
assertFalse(b.getStorageNodes().getChildren().get("1").getAffinity().isPresent());
assertFalse(b.getStorageNodes().getChildren().get("2").getAffinity().isPresent());
assertFalse(b.getStorageNodes().getChildren().get("3").getAffinity().isPresent());
assertFalse(b.getStorageNodes().getChildren().get("4").getAffinity().isPresent());
assertFalse(b.getStorageNodes().getChildren().get("5").getAffinity().isPresent());
// assertThat(b.getStorageNodes().getChildren().get("0").getAffinity().get().cpuSocket(), is(0));
// assertThat(b.getStorageNodes().getChildren().get("1").getAffinity().get().cpuSocket(), is(1));
// assertThat(b.getStorageNodes().getChildren().get("2").getAffinity().get().cpuSocket(), is(2));
// assertThat(b.getStorageNodes().getChildren().get("3").getAffinity().get().cpuSocket(), is(0));
// assertThat(b.getStorageNodes().getChildren().get("4").getAffinity().get().cpuSocket(), is(1));
// assertThat(b.getStorageNodes().getChildren().get("5").getAffinity().get().cpuSocket(), is(0));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureMmapNoCoreLimit.
@Test
public void canConfigureMmapNoCoreLimit() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group mmap-core-limit=\"200000\">" + " <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().getMmapNoCoreLimit().isPresent());
assertEquals(200000, b.getRootGroup().getMmapNoCoreLimit().get().longValue());
assertThat(s.getSearchNodes().size(), is(2));
assertEquals(200000, s.getSearchNodes().get(0).getMMapNoCoreLimit());
assertEquals(200000, s.getSearchNodes().get(1).getMMapNoCoreLimit());
assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(0).getMMapNoCoreEnvVariable());
assertEquals("VESPA_MMAP_NOCORE_LIMIT=200000 ", s.getSearchNodes().get(1).getMMapNoCoreEnvVariable());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method handleSingleNonSearchPersistentVds.
@Test
public void handleSingleNonSearchPersistentVds() 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());
assertTrue(a.getPersistence() instanceof VDSEngine.Factory);
assertEquals(1, a.getStorageNodes().getChildren().size());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method handleSingleNonSearchPersistentDummy.
@Test
public void handleSingleNonSearchPersistentDummy() throws Exception {
ContentCluster a = createContent("<content version =\"1.0\" id=\"a\">" + " <redundancy>3</redundancy>" + " <documents>" + " <document type=\"music\" mode=\"store-only\"/>" + " </documents>" + " <engine>" + " <dummy/>" + " </engine>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " </group>" + "</content>");
ContentSearchCluster s = a.getSearch();
assertFalse(s.hasIndexedCluster());
assertTrue(s.getClusters().isEmpty());
assertTrue(a.getPersistence() instanceof com.yahoo.vespa.model.content.engines.DummyPersistence.Factory);
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class MultilevelDispatchTest method requireThatDispatchGroupsCanBeExplicitlySpecified.
@Test
public void requireThatDispatchGroupsCanBeExplicitlySpecified() throws Exception {
ContentCluster cr = createCluster(getDispatchXml());
IndexedSearchCluster ix = cr.getSearch().getIndexed();
Dispatch tld = cr.getSearch().getIndexed().getTLDs().get(0);
assertEquals("tlds/tld.0", tld.getConfigId());
assertEquals(0, getFdispatchrcConfig(tld).dispatchlevel());
new EngineAsserter(2, 6, tld).assertEngine(0, 0, "tcp/mh0:19113").assertEngine(1, 0, "tcp/mh2:19113").assertEngine(2, 0, "tcp/mh4:19113").assertEngine(0, 1, "tcp/mh1:19113").assertEngine(1, 1, "tcp/mh3:19113").assertEngine(2, 1, "tcp/mh5:19113");
List<Dispatch> ds = getDispatchers(tld);
assertEquals(6, ds.size());
{
// dispatch group 1
Dispatch[] dispatchers = { ds.get(0), ds.get(1), ds.get(2) };
String[] specs = { "tcp/mh0:19104", "tcp/mh2:19104", "tcp/mh4:19104" };
SearchNode[] searchNodes = { ix.getSearchNode(0), ix.getSearchNode(2), ix.getSearchNode(4) };
assertDispatchAndSearchNodes(0, dispatchers, specs, searchNodes);
}
{
// dispatch group 2
Dispatch[] dispatchers = { ds.get(3), ds.get(4), ds.get(5) };
String[] specs = { "tcp/mh1:19104", "tcp/mh3:19104", "tcp/mh5:19104" };
SearchNode[] searchNodes = { ix.getSearchNode(1), ix.getSearchNode(3), ix.getSearchNode(5) };
assertDispatchAndSearchNodes(1, dispatchers, specs, searchNodes);
}
}
Aggregations