Search in sources :

Example 1 with DocumentProcessor

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

the class DocprocBuilderTest method testDocprocCluster.

// TODO: re-enable assertions when the appropriate attributes are handled by the builder
@Test
public void testDocprocCluster() {
    assertThat(cluster.getName(), is("banan"));
    assertThat(cluster.getDocproc().isCompressDocuments(), is(true));
    // assertThat(cluster.getContainerDocproc().isPreferLocalNode(), is(true));
    // assertThat(cluster.getContainerDocproc().getNumNodesPerClient(), is(2));
    List<Container> services = cluster.getContainers();
    assertThat(services.size(), is(1));
    Container service = services.get(0);
    assertThat(service, notNullValue());
    Map<String, DocprocChain> chains = new HashMap<>();
    for (DocprocChain chain : cluster.getDocprocChains().allChains().allComponents()) {
        chains.put(chain.getId().stringValue(), chain);
    }
    assertThat(chains.size(), is(1));
    DocprocChain chain = chains.get("chein");
    assertThat(chain.getId().stringValue(), is("chein"));
    assertThat(chain.getInnerComponents().size(), is(1));
    DocumentProcessor processor = chain.getInnerComponents().iterator().next();
    assertThat(processor.getComponentId().stringValue(), is("docproc2"));
}
Also used : Container(com.yahoo.vespa.model.container.Container) HashMap(java.util.HashMap) DocumentProcessor(com.yahoo.vespa.model.container.docproc.DocumentProcessor) DocprocChain(com.yahoo.vespa.model.container.docproc.DocprocChain) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Aggregations

DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 Container (com.yahoo.vespa.model.container.Container)1 DocprocChain (com.yahoo.vespa.model.container.docproc.DocprocChain)1 DocumentProcessor (com.yahoo.vespa.model.container.docproc.DocumentProcessor)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1