use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class AccessControlTest method getHttp.
private Http getHttp(Element clusterElem) throws SAXException, IOException {
createModel(root, clusterElem);
ContainerCluster cluster = (ContainerCluster) root.getChildren().get("jdisc");
Http http = cluster.getHttp();
assertNotNull(http);
return http;
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class ContainerDocumentApiBuilderTest method document_api_config_is_added_to_container_cluster.
@Test
public void document_api_config_is_added_to_container_cluster() throws Exception {
Element elem = DomBuilderTest.parse("<jdisc id='cluster1' version='1.0'>", " <document-api>", " <abortondocumenterror>false</abortondocumenterror>", " <maxpendingdocs>4321</maxpendingdocs>", " <retrydelay>12.34</retrydelay>", " <route>non-default</route>", " </document-api>", nodesXml, "</jdisc>");
createModel(root, elem);
ContainerCluster cluster = (ContainerCluster) root.getProducer("cluster1");
FeederConfig.Builder builder = new FeederConfig.Builder();
cluster.getDocumentApi().getConfig(builder);
FeederConfig config = new FeederConfig(builder);
assertThat(config.abortondocumenterror(), is(false));
assertThat(config.maxpendingdocs(), is(4321));
assertThat(config.retrydelay(), is(12.34));
assertThat(config.route(), is("non-default"));
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class ContainerDocumentApiBuilderTest method getHandlers.
private Map<String, Handler<?>> getHandlers(String clusterName) {
ContainerCluster cluster = (ContainerCluster) root.getChildren().get(clusterName);
Map<String, Handler<?>> handlerMap = new HashMap<>();
Collection<Handler<?>> handlers = cluster.getHandlers();
for (Handler<?> handler : handlers) {
// die on overwrites
assertThat(handlerMap.containsKey(handler.getComponentId().toString()), is(false));
handlerMap.put(handler.getComponentId().toString(), handler);
}
return handlerMap;
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class ClusterTest method testEndToEnd.
@Test
public void testEndToEnd() throws Exception {
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + "<services>\n" + "\n" + " <admin version=\"2.0\">\n" + " <adminserver hostalias=\"configserver\" />\n" + " <logserver hostalias=\"logserver\" />\n" + " <slobroks>\n" + " <slobrok hostalias=\"configserver\" />\n" + " <slobrok hostalias=\"logserver\" />\n" + " </slobroks>\n" + " <cluster-controllers>\n" + " <cluster-controller hostalias=\"configserver\"/>" + " <cluster-controller hostalias=\"configserver2\"/>" + " <cluster-controller hostalias=\"configserver3\"/>" + " </cluster-controllers>\n" + " </admin>\n" + " <content version='1.0' id='bar'>" + " <redundancy>1</redundancy>\n" + " <documents>" + " <document type=\"type1\" mode=\"index\"/>\n" + " <document type=\"type2\" mode=\"index\"/>\n" + " </documents>\n" + " <group>" + " <node hostalias='node0' distribution-key='0' />" + " </group>" + " <tuning>" + " <cluster-controller>\n" + " <init-progress-time>34567</init-progress-time>" + " </cluster-controller>" + " </tuning>" + " </content>" + "\n" + "</services>";
List<String> sds = ApplicationPackageUtils.generateSearchDefinitions("type1", "type2");
VespaModel model = (new VespaModelCreatorWithMockPkg(null, xml, sds)).create();
assertEquals(2, model.getContentClusters().get("bar").getDocumentDefinitions().size());
ContainerCluster cluster = model.getAdmin().getClusterControllers();
assertEquals(3, cluster.getContainers().size());
}
use of com.yahoo.vespa.model.container.ContainerCluster in project vespa by vespa-engine.
the class StandaloneDocprocContainerTest method requireNoMbusProvidersWhenStandalone.
@Test
public void requireNoMbusProvidersWhenStandalone() {
ContainerCluster containerCluster = setupCluster(true);
Map<ComponentId, Component<?, ?>> components = containerCluster.getComponentsMap();
boolean foundAtLeastOneClient = false;
boolean foundAtLeastOneServer = false;
for (ComponentId componentId : components.keySet()) {
if (componentId.stringValue().contains("MbusClient"))
foundAtLeastOneClient = true;
if (componentId.stringValue().contains("MbusServer"))
foundAtLeastOneServer = true;
}
assertThat(foundAtLeastOneClient, is(false));
assertThat(foundAtLeastOneServer, is(false));
}
Aggregations