Search in sources :

Example 1 with ChainRegistry

use of com.yahoo.processing.execution.chain.ChainRegistry in project vespa by vespa-engine.

the class MockUserDatabaseClientTest method setupJDisc.

private void setupJDisc(Collection<Chain<Processor>> chains) {
    driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi();
    ContainerBuilder builder = driver.newContainerBuilder();
    ChainRegistry<Processor> registry = new ChainRegistry<>();
    for (Chain<Processor> chain : chains) registry.register(chain.getId(), chain);
    builder.clientBindings().bind("pio://endpoint/*", new MockUserDatabaseRequestHandler());
    driver.activateContainer(builder);
}
Also used : ContainerBuilder(com.yahoo.jdisc.application.ContainerBuilder) Processor(com.yahoo.processing.Processor) ChainRegistry(com.yahoo.processing.execution.chain.ChainRegistry)

Example 2 with ChainRegistry

use of com.yahoo.processing.execution.chain.ChainRegistry in project vespa by vespa-engine.

the class FilterChainRepository method buildChainRegistry.

private static ChainRegistry<FilterWrapper> buildChainRegistry(ChainsConfig chainsConfig, ComponentRegistry<?>... filters) {
    ChainRegistry<FilterWrapper> chainRegistry = new ChainRegistry<>();
    ChainsModel chainsModel = ChainsModelBuilder.buildFromConfig(chainsConfig);
    ChainsConfigurer.prepareChainRegistry(chainRegistry, chainsModel, allFiltersWrapped(filters));
    chainRegistry.freeze();
    return chainRegistry;
}
Also used : ChainsModel(com.yahoo.component.chain.model.ChainsModel) ChainRegistry(com.yahoo.processing.execution.chain.ChainRegistry)

Example 3 with ChainRegistry

use of com.yahoo.processing.execution.chain.ChainRegistry in project vespa by vespa-engine.

the class ProcessingTestDriver method createProcessingHandler.

private static ProcessingHandler createProcessingHandler(Collection<Chain<Processor>> chains, ComponentRegistry<Renderer> renderers, AccessLog accessLog) {
    Executor executor = Executors.newSingleThreadExecutor();
    ChainRegistry<Processor> registry = new ChainRegistry<>();
    for (Chain<Processor> chain : chains) registry.register(chain.getId(), chain);
    return new ProcessingHandler(registry, renderers, executor, accessLog);
}
Also used : Executor(java.util.concurrent.Executor) Processor(com.yahoo.processing.Processor) ChainRegistry(com.yahoo.processing.execution.chain.ChainRegistry)

Example 4 with ChainRegistry

use of com.yahoo.processing.execution.chain.ChainRegistry in project vespa by vespa-engine.

the class ApplicationStatusHandlerTest method chains_are_rendered.

@Test
public void chains_are_rendered() throws Exception {
    ChainRegistry<Processor> chains = new ChainRegistry<>();
    Chain<Processor> chain = new Chain<Processor>("myChain", new VoidProcessor(new ComponentId("voidProcessor")));
    chains.register(new ComponentId("myChain"), chain);
    String json = ApplicationStatusHandler.StatusResponse.renderChains(chains).toString();
    assertThat(json, containsString("myChain"));
    assertThat(json, containsString("voidProcessor"));
}
Also used : Chain(com.yahoo.component.chain.Chain) Processor(com.yahoo.processing.Processor) ChainRegistry(com.yahoo.processing.execution.chain.ChainRegistry) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ComponentId(com.yahoo.component.ComponentId) Test(org.junit.Test)

Aggregations

ChainRegistry (com.yahoo.processing.execution.chain.ChainRegistry)4 Processor (com.yahoo.processing.Processor)3 ComponentId (com.yahoo.component.ComponentId)1 Chain (com.yahoo.component.chain.Chain)1 ChainsModel (com.yahoo.component.chain.model.ChainsModel)1 ContainerBuilder (com.yahoo.jdisc.application.ContainerBuilder)1 Executor (java.util.concurrent.Executor)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Test (org.junit.Test)1