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