use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureCpuAffinity.
@Test
public void canConfigureCpuAffinity() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\" cpu-socket=\"0\" />" + " <node hostalias=\"mockhost\" distribution-key=\"1\" cpu-socket=\"1\" />" + " </group>" + "</content>");
ContentSearchCluster s;
s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(2, b.getStorageNodes().getChildren().size());
assertTrue(b.getStorageNodes().getChildren().get("0").getAffinity().isPresent());
assertThat(b.getStorageNodes().getChildren().get("0").getAffinity().get().cpuSocket(), is(0));
assertTrue(b.getStorageNodes().getChildren().get("1").getAffinity().isPresent());
assertThat(b.getStorageNodes().getChildren().get("1").getAffinity().get().cpuSocket(), is(1));
assertThat(s.getSearchNodes().size(), is(2));
assertTrue(s.getSearchNodes().get(0).getAffinity().isPresent());
assertThat(s.getSearchNodes().get(0).getAffinity().get().cpuSocket(), is(0));
assertTrue(s.getSearchNodes().get(1).getAffinity().isPresent());
assertThat(s.getSearchNodes().get(1).getAffinity().get().cpuSocket(), is(1));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method handleStreamingOnlyWithoutPersistence.
@Test
public void handleStreamingOnlyWithoutPersistence() throws Exception {
final String musicClusterId = "music-cluster-id";
ContentCluster cluster = createContent("<content version='1.0' id='" + musicClusterId + "'>" + " <redundancy>3</redundancy>" + " <documents>" + " <document type='music' mode='streaming'/>" + " </documents>" + " <engine>" + " <vds/>" + " </engine>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " </group>" + "</content>");
ContentSearchCluster s;
s = cluster.getSearch();
assertFalse(s.hasIndexedCluster());
assertEquals(1, s.getClusters().size());
assertNull(s.getIndexed());
AbstractSearchCluster sc = s.getClusters().get(musicClusterId + ".music");
assertEquals(musicClusterId + ".music", sc.getClusterName());
assertEquals(musicClusterId, ((StreamingSearchCluster) sc).getStorageRouteSpec());
assertTrue(cluster.getPersistence() instanceof VDSEngine.Factory);
assertEquals(1, cluster.getStorageNodes().getChildren().size());
assertEquals(musicClusterId, cluster.getConfigId());
// assertEquals("content/a/0", a.getRootGroup().getNodes().get(0).getConfigId());
// Due to reuse.
assertEquals(musicClusterId + "/storage/0", cluster.getRootGroup().getNodes().get(0).getConfigId());
assertEquals(1, cluster.getRoot().getHostSystem().getHosts().size());
HostResource h = cluster.getRoot().getHostSystem().getHost("mockhost");
String[] expectedServices = { "logd", "configproxy", "config-sentinel", "configserver", "logserver", "slobrok", "container-clustercontroller", "storagenode", "distributor" };
assertServices(h, expectedServices);
assertEquals(musicClusterId + "/storage/0", h.getService("storagenode").getConfigId());
/* Not yet
assertNotNull(h.getService("qrserver"));
assertNotNull(h.getService("topleveldisptach"));
assertNotNull(h.getService("docproc"));
*/
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method defaultCoreOnOOMIsFalse.
@Test
public void defaultCoreOnOOMIsFalse() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\" />" + " <node hostalias=\"mockhost\" distribution-key=\"1\" />" + " </group>" + "</content>");
ContentSearchCluster s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(2, b.getStorageNodes().getChildren().size());
assertFalse(b.getRootGroup().getCoreOnOOM().isPresent());
assertThat(s.getSearchNodes().size(), is(2));
assertFalse(s.getSearchNodes().get(0).getCoreOnOOM());
assertFalse(s.getSearchNodes().get(1).getCoreOnOOM());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true ", s.getSearchNodes().get(0).getCoreOnOOMEnvVariable());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true ", s.getSearchNodes().get(1).getCoreOnOOMEnvVariable());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method canConfigureVespaMallocPerHost.
@Test
public void canConfigureVespaMallocPerHost() throws Exception {
ContentCluster b = createContent("<content version =\"1.0\" id=\"b\">" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\" no-vespamalloc=\"proton\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"1\" vespamalloc-debug=\"distributord\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"2\" vespamalloc-debug-stacktrace=\"all\"/>" + " <node hostalias=\"mockhost\" distribution-key=\"3\" vespamalloc=\"storaged\"/>" + " </group>" + "</content>");
ContentSearchCluster s = b.getSearch();
assertTrue(s.hasIndexedCluster());
assertNotNull(s.getIndexed());
assertEquals(4, b.getStorageNodes().getChildren().size());
assertFalse(b.getRootGroup().getNoVespaMalloc().isPresent());
assertFalse(b.getRootGroup().getVespaMalloc().isPresent());
assertFalse(b.getRootGroup().getVespaMallocDebug().isPresent());
assertFalse(b.getRootGroup().getVespaMallocDebugStackTrace().isPresent());
assertThat(s.getSearchNodes().size(), is(4));
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true VESPA_USE_NO_VESPAMALLOC=\"proton\" ", s.getSearchNodes().get(0).getEnvVariables());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true VESPA_USE_VESPAMALLOC_D=\"distributord\" ", s.getSearchNodes().get(1).getEnvVariables());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true VESPA_USE_VESPAMALLOC_DST=\"all\" ", s.getSearchNodes().get(2).getEnvVariables());
assertEquals("VESPA_SILENCE_CORE_ON_OOM=true VESPA_USE_VESPAMALLOC=\"storaged\" ", s.getSearchNodes().get(3).getEnvVariables());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentBuilderTest method requireThatContentStreamingHandlesMultipleSearchDefinitions.
@Test
public void requireThatContentStreamingHandlesMultipleSearchDefinitions() throws Exception {
final String musicClusterId = "music-cluster-id";
ContentCluster cluster = createContentWithBooksToo("<content version='1.0' id='" + musicClusterId + "'>" + " <redundancy>3</redundancy>" + " <documents>" + " <document type='music' mode='streaming'/>" + " <document type='book' mode='streaming'/>" + " </documents>" + " <engine>" + " <vds/>" + " </engine>" + " <group>" + " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " </group>" + "</content>");
ContentSearchCluster s;
s = cluster.getSearch();
assertFalse(s.hasIndexedCluster());
assertEquals(2, s.getClusters().size());
assertNull(s.getIndexed());
{
String id = musicClusterId + ".book";
AbstractSearchCluster sc = s.getClusters().get(id);
assertEquals(id, sc.getClusterName());
assertEquals(musicClusterId, ((StreamingSearchCluster) sc).getStorageRouteSpec());
}
{
String id = musicClusterId + ".music";
AbstractSearchCluster sc = s.getClusters().get(id);
assertEquals(id, sc.getClusterName());
assertEquals(musicClusterId, ((StreamingSearchCluster) sc).getStorageRouteSpec());
}
assertTrue(cluster.getPersistence() instanceof VDSEngine.Factory);
assertEquals(1, cluster.getStorageNodes().getChildren().size());
assertEquals(musicClusterId, cluster.getConfigId());
}
Aggregations