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])));
}
}
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);
}
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));
}
}
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());
}
Aggregations