use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class AdminTestCase method testContainerMetricsSnapshotInterval.
@Test
public void testContainerMetricsSnapshotInterval() throws Exception {
VespaModel vespaModel = getVespaModel(TESTDIR + "metricconfig");
ContainerCluster docprocCluster = vespaModel.getContainerClusters().get("cluster.music.indexing");
HealthMonitorConfig.Builder builder = new HealthMonitorConfig.Builder();
docprocCluster.getConfig(builder);
HealthMonitorConfig docprocConfig = new HealthMonitorConfig(builder);
assertEquals(60, (int) docprocConfig.snapshot_interval());
ContainerCluster qrCluster = vespaModel.getContainerClusters().get("container");
builder = new HealthMonitorConfig.Builder();
qrCluster.getConfig(builder);
HealthMonitorConfig qrClusterConfig = new HealthMonitorConfig(builder);
assertEquals(60, (int) qrClusterConfig.snapshot_interval());
StatisticsComponent stat = null;
for (Component component : qrCluster.getAllComponents()) {
if (component.getClassId().getName().contains("com.yahoo.statistics.StatisticsImpl")) {
stat = (StatisticsComponent) component;
break;
}
}
assertNotNull(stat);
StatisticsConfig.Builder sb = new StatisticsConfig.Builder();
stat.getConfig(sb);
StatisticsConfig sc = new StatisticsConfig(sb);
assertEquals(60, (int) sc.collectionintervalsec());
assertEquals(60, (int) sc.loggingintervalsec());
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class SearchBuilderTest method cluster_is_connected_to_search_clusters.
@Test
public void cluster_is_connected_to_search_clusters() throws Exception {
String hosts = hostsXml();
String services = "" + "<services>" + " <admin version='2.0'>" + " <adminserver hostalias='mockhost'/>" + " </admin>" + " <jdisc version='1.0' id='container'>" + " <search>" + " <chain id='mychain' inherits='vespa'/>" + " </search>" + " <nodes>" + " <node hostalias=\"mockhost\" />" + " </nodes>" + " </jdisc>" + contentXml() + "</services>";
VespaModel model = getVespaModelWithMusic(hosts, services);
ContainerCluster cluster = model.getContainerClusters().get("container");
assertFalse(cluster.getSearchChains().localProviders().isEmpty());
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class SearchBuilderTest method cluster_with_only_search_gets_qrserver_as_service_name.
// TODO: remove test when all containers are named 'container'
@Test
public void cluster_with_only_search_gets_qrserver_as_service_name() throws Exception {
createClusterWithOnlyDefaultChains();
ContainerCluster cluster = (ContainerCluster) root.getChildren().get("default");
assertThat(cluster.getContainers().get(0).getServiceName(), is("qrserver"));
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class IndexingAndDocprocRoutingTest method assertIndexing.
private void assertIndexing(VespaModel model, DocprocClusterSpec... expectedDocprocClusters) {
Map<String, ContainerCluster> docprocClusters = getDocprocClusters(model);
assertThat(docprocClusters.size(), is(expectedDocprocClusters.length));
for (DocprocClusterSpec expectedDocprocCluster : expectedDocprocClusters) {
ContainerCluster docprocCluster = docprocClusters.get(expectedDocprocCluster.name);
assertThat(docprocCluster, not(nullValue()));
assertThat(docprocCluster.getName(), is(expectedDocprocCluster.name));
ContainerDocproc containerDocproc = docprocCluster.getDocproc();
assertThat(containerDocproc, not(nullValue()));
List<DocprocChain> chains = containerDocproc.getChains().allChains().allComponents();
assertThat(chains.size(), is(expectedDocprocCluster.chains.size()));
List<String> actualDocprocChains = new ArrayList<>();
for (DocprocChain chain : chains) {
actualDocprocChains.add(chain.getServiceName());
}
List<String> expectedDocprocChainStrings = new ArrayList<>();
for (DocprocChainSpec spec : expectedDocprocCluster.chains) {
expectedDocprocChainStrings.add(spec.name);
}
assertThat(actualDocprocChains, hasItems(expectedDocprocChainStrings.toArray(new String[0])));
}
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class IndexedTest method requireThatIndexingDocprocGetsConfigIdBasedOnDistributionKey.
@Test
public void requireThatIndexingDocprocGetsConfigIdBasedOnDistributionKey() {
VespaModel model = getIndexedVespaModel();
ContainerCluster cluster = model.getContainerClusters().get("cluster.test.indexing");
assertEquals("docproc/cluster.test.indexing/3", cluster.getContainers().get(0).getConfigId());
}
Aggregations