Search in sources :

Example 1 with ChainSpecification

use of com.yahoo.component.chain.model.ChainSpecification in project vespa by vespa-engine.

the class ContainerDocumentApi method setupLegacySearchers.

private void setupLegacySearchers(ContainerCluster cluster) {
    Set<ComponentSpecification> inherited = new TreeSet<>();
    SearchChain vespaGetChain = new SearchChain(new ChainSpecification(new ComponentId("vespaget"), new ChainSpecification.Inheritance(inherited, null), new ArrayList<>(), new TreeSet<>()));
    vespaGetChain.addInnerComponent(newVespaClientSearcher("com.yahoo.storage.searcher.GetSearcher"));
    SearchChain vespaVisitChain = new SearchChain(new ChainSpecification(new ComponentId("vespavisit"), new ChainSpecification.Inheritance(inherited, null), new ArrayList<>(), new TreeSet<>()));
    vespaVisitChain.addInnerComponent(newVespaClientSearcher("com.yahoo.storage.searcher.VisitSearcher"));
    SearchChains chains;
    if (cluster.getSearch() != null) {
        chains = cluster.getSearchChains();
    } else {
        chains = new SearchChains(cluster, "searchchain");
    }
    chains.add(vespaGetChain);
    chains.add(vespaVisitChain);
    if (cluster.getSearch() == null) {
        ContainerSearch containerSearch = new ContainerSearch(cluster, chains, new ContainerSearch.Options());
        cluster.setSearch(containerSearch);
        ProcessingHandler<SearchChains> searchHandler = new ProcessingHandler<>(chains, "com.yahoo.search.handler.SearchHandler");
        searchHandler.addServerBindings("http://*/search/*", "https://*/search/*");
        cluster.addComponent(searchHandler);
    }
}
Also used : SearchChains(com.yahoo.vespa.model.container.search.searchchain.SearchChains) ComponentSpecification(com.yahoo.component.ComponentSpecification) ProcessingHandler(com.yahoo.vespa.model.container.component.chain.ProcessingHandler) ContainerSearch(com.yahoo.vespa.model.container.search.ContainerSearch) ChainSpecification(com.yahoo.component.chain.model.ChainSpecification) ArrayList(java.util.ArrayList) SearchChain(com.yahoo.vespa.model.container.search.searchchain.SearchChain) TreeSet(java.util.TreeSet) ComponentId(com.yahoo.component.ComponentId)

Example 2 with ChainSpecification

use of com.yahoo.component.chain.model.ChainSpecification in project vespa by vespa-engine.

the class ChainsConfigurer method instantiateChains.

private static <COMPONENT extends ChainedComponent> void instantiateChains(ComponentRegistry<Chain<COMPONENT>> chainRegistry, ChainsModel model, ComponentRegistry<COMPONENT> allComponents) {
    for (ChainSpecification chain : model.allChainsFlattened()) {
        try {
            Chain<COMPONENT> componentChain = new Chain<>(chain.componentId, resolveComponents(chain.componentReferences, allComponents), chain.phases());
            chainRegistry.register(chain.componentId, componentChain);
        } catch (Exception e) {
            throw new ConfigurationRuntimeException("Invalid chain '" + chain.componentId + "'", e);
        }
    }
}
Also used : ConfigurationRuntimeException(com.yahoo.config.ConfigurationRuntimeException) ChainSpecification(com.yahoo.component.chain.model.ChainSpecification) ConfigurationRuntimeException(com.yahoo.config.ConfigurationRuntimeException)

Example 3 with ChainSpecification

use of com.yahoo.component.chain.model.ChainSpecification in project vespa by vespa-engine.

the class DomChainBuilderBase method doBuild.

public final CHAIN doBuild(AbstractConfigProducer ancestor, Element producerSpec) {
    ComponentsBuilder<COMPONENT> componentsBuilder = new ComponentsBuilder<>(ancestor, allowedComponentTypes, Arrays.asList(producerSpec), outerComponentTypeByComponentName);
    ChainSpecification specWithoutInnerComponents = new ChainSpecificationBuilder(producerSpec).build(componentsBuilder.getOuterComponentReferences());
    CHAIN chain = buildChain(ancestor, producerSpec, specWithoutInnerComponents);
    addInnerComponents(chain, componentsBuilder.getComponentDefinitions());
    return chain;
}
Also used : ChainSpecification(com.yahoo.component.chain.model.ChainSpecification)

Aggregations

ChainSpecification (com.yahoo.component.chain.model.ChainSpecification)3 ComponentId (com.yahoo.component.ComponentId)1 ComponentSpecification (com.yahoo.component.ComponentSpecification)1 ConfigurationRuntimeException (com.yahoo.config.ConfigurationRuntimeException)1 ProcessingHandler (com.yahoo.vespa.model.container.component.chain.ProcessingHandler)1 ContainerSearch (com.yahoo.vespa.model.container.search.ContainerSearch)1 SearchChain (com.yahoo.vespa.model.container.search.searchchain.SearchChain)1 SearchChains (com.yahoo.vespa.model.container.search.searchchain.SearchChains)1 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1