Search in sources :

Example 1 with ContainerDocproc

use of com.yahoo.vespa.model.container.docproc.ContainerDocproc 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])));
    }
}
Also used : DocprocChain(com.yahoo.vespa.model.container.docproc.DocprocChain) ContainerCluster(com.yahoo.vespa.model.container.ContainerCluster) ContainerDocproc(com.yahoo.vespa.model.container.docproc.ContainerDocproc)

Example 2 with ContainerDocproc

use of com.yahoo.vespa.model.container.docproc.ContainerDocproc in project vespa by vespa-engine.

the class ContainerModelBuilder method buildDocproc.

private ContainerDocproc buildDocproc(ContainerCluster cluster, Element spec) {
    Element docprocElement = XML.getChild(spec, "document-processing");
    if (docprocElement == null)
        return null;
    addIncludes(docprocElement);
    DocprocChains chains = new DomDocprocChainsBuilder(null, false).build(cluster, docprocElement);
    ContainerDocproc.Options docprocOptions = DocprocOptionsBuilder.build(docprocElement);
    return new ContainerDocproc(cluster, chains, docprocOptions, !standaloneBuilder);
}
Also used : ModelElement(com.yahoo.vespa.model.builder.xml.dom.ModelElement) Element(org.w3c.dom.Element) DocprocChains(com.yahoo.vespa.model.container.docproc.DocprocChains) DomDocprocChainsBuilder(com.yahoo.vespa.model.builder.xml.dom.chains.docproc.DomDocprocChainsBuilder) ContainerDocproc(com.yahoo.vespa.model.container.docproc.ContainerDocproc)

Example 3 with ContainerDocproc

use of com.yahoo.vespa.model.container.docproc.ContainerDocproc in project vespa by vespa-engine.

the class ContainerModelBuilder method addDocproc.

private void addDocproc(Element spec, ContainerCluster cluster) {
    ContainerDocproc containerDocproc = buildDocproc(cluster, spec);
    if (containerDocproc != null) {
        cluster.setDocproc(containerDocproc);
        ContainerDocproc.Options docprocOptions = containerDocproc.options;
        cluster.setMbusParams(new ContainerCluster.MbusParams(docprocOptions.maxConcurrentFactor, docprocOptions.documentExpansionFactor, docprocOptions.containerCoreMemory));
    }
}
Also used : ContainerCluster(com.yahoo.vespa.model.container.ContainerCluster) ContainerDocproc(com.yahoo.vespa.model.container.docproc.ContainerDocproc)

Example 4 with ContainerDocproc

use of com.yahoo.vespa.model.container.docproc.ContainerDocproc in project vespa by vespa-engine.

the class ContainerClusterTest method verifyJvmArgs.

private void verifyJvmArgs(boolean isHosted, boolean hasDocProc) {
    ContainerCluster cluster = createContainerCluster(isHosted, false);
    if (hasDocProc) {
        cluster.setDocproc(new ContainerDocproc(cluster, null));
    }
    addContainer(cluster, "c1", "host-c1");
    assertEquals(1, cluster.getContainers().size());
    Container container = cluster.getContainers().get(0);
    verifyJvmArgs(isHosted, hasDocProc, "", container.getJvmArgs());
    container.setJvmArgs("initial");
    verifyJvmArgs(isHosted, hasDocProc, "initial", container.getJvmArgs());
    container.prependJvmArgs("ignored");
    verifyJvmArgs(isHosted, hasDocProc, "ignored initial", container.getJvmArgs());
    container.appendJvmArgs("override");
    verifyJvmArgs(isHosted, hasDocProc, "ignored initial override", container.getJvmArgs());
    container.setJvmArgs(null);
    verifyJvmArgs(isHosted, hasDocProc, "", container.getJvmArgs());
}
Also used : ClusterControllerContainer(com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer) ContainerDocproc(com.yahoo.vespa.model.container.docproc.ContainerDocproc)

Aggregations

ContainerDocproc (com.yahoo.vespa.model.container.docproc.ContainerDocproc)4 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)2 ClusterControllerContainer (com.yahoo.vespa.model.admin.clustercontroller.ClusterControllerContainer)1 ModelElement (com.yahoo.vespa.model.builder.xml.dom.ModelElement)1 DomDocprocChainsBuilder (com.yahoo.vespa.model.builder.xml.dom.chains.docproc.DomDocprocChainsBuilder)1 DocprocChain (com.yahoo.vespa.model.container.docproc.DocprocChain)1 DocprocChains (com.yahoo.vespa.model.container.docproc.DocprocChains)1 Element (org.w3c.dom.Element)1