use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatDispatcherIsCorrectWithOneGroup.
@Test
public void requireThatDispatcherIsCorrectWithOneGroup() throws Exception {
ContentCluster c = getOneGroupCluster();
PartitionsConfig.Dataset dataset = getDataset(c.getSearch().getIndexed().getTLDs().get(0));
assertEquals(3, dataset.numparts());
assertEquals(PartitionsConfig.Dataset.Querydistribution.AUTOMATIC, dataset.querydistribution());
List<PartitionsConfig.Dataset.Engine> engines = dataset.engine();
assertEquals(3, engines.size());
assertEngine(0, 0, engines.get(0));
assertEngine(0, 1, engines.get(1));
assertEngine(0, 2, engines.get(2));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedTest method requireCorrectClusterList.
@Test
public void requireCorrectClusterList() {
VespaModel model = getStreamingVespaModel();
ContentCluster s = model.getContentClusters().get("test");
assertNotNull(s);
assertFalse(s.getSearch().hasIndexedCluster());
ClusterListConfig config = model.getConfig(ClusterListConfig.class, VespaModel.ROOT_CONFIGID);
assertThat(config.storage().size(), is(1));
assertThat(config.storage(0).name(), is("test"));
assertThat(config.storage(0).configid(), is("test"));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class StorageClusterTest method parse.
StorageCluster parse(String xml) throws Exception {
MockRoot root = new MockRoot();
root.getDeployState().getDocumentModel().getDocumentManager().add(new NewDocumentType(new NewDocumentType.Name("music")));
root.getDeployState().getDocumentModel().getDocumentManager().add(new NewDocumentType(new NewDocumentType.Name("movies")));
ContentCluster cluster = ContentClusterUtils.createCluster(xml, root);
root.freezeModelTopology();
return cluster.getStorageNodes();
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class StorageGroupTest method testSingleGroup.
@Test
public void testSingleGroup() throws Exception {
StorDistributionConfig.Builder builder = new StorDistributionConfig.Builder();
ContentCluster cluster = parse("<content id=\"storage\">\n" + " <documents/>" + " <group>\n" + " <node jvmargs=\"foo\" hostalias=\"mockhost\" distribution-key=\"0\"/>\n" + " <node hostalias=\"mockhost\" distribution-key=\"1\"/>\n" + " </group>\n" + "</content>");
cluster.getConfig(builder);
assertEquals("content", cluster.getStorageNodes().getChildren().get("0").getServicePropertyString("clustertype"));
assertEquals("storage", cluster.getStorageNodes().getChildren().get("0").getServicePropertyString("clustername"));
assertEquals("0", cluster.getStorageNodes().getChildren().get("0").getServicePropertyString("index"));
assertEquals("content", cluster.getDistributorNodes().getChildren().get("0").getServicePropertyString("clustertype"));
assertEquals("storage", cluster.getDistributorNodes().getChildren().get("0").getServicePropertyString("clustername"));
assertEquals("0", cluster.getDistributorNodes().getChildren().get("0").getServicePropertyString("index"));
StorDistributionConfig config = new StorDistributionConfig(builder);
assertEquals(1, config.group().size());
assertEquals("invalid", config.group(0).index());
assertEquals("invalid", config.group(0).name());
assertEquals(2, config.group(0).nodes().size());
assertEquals(0, config.group(0).nodes(0).index());
assertEquals(1, config.group(0).nodes(1).index());
// assertNotNull(cluster.getRootGroup().getNodes().get(0).getHost());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class ContentClusterUtils method createCluster.
public static ContentCluster createCluster(String clusterXml, List<String> searchDefinitions) throws Exception {
MockRoot root = createMockRoot(searchDefinitions);
ContentCluster cluster = createCluster(clusterXml, root);
root.freezeModelTopology();
cluster.validate();
return cluster;
}
Aggregations