public ChainSpecification build(Set<ComponentSpecification> outerComponentReferences) { return new ChainSpecification(componentId, inheritance, phases, outerComponentReferences); } }
public ChainSpecification addComponents(Collection<ComponentSpecification> componentSpecifications) { Set<ComponentSpecification> newComponentReferences = new LinkedHashSet<>(componentReferences); newComponentReferences.addAll(componentSpecifications); return new ChainSpecification(componentId, inheritance, phases(), newComponentReferences); }
public ChainSpecification setComponentId(ComponentId newComponentId) { return new ChainSpecification(newComponentId, inheritance, phases(), componentReferences); }
public static ChainSpecification emptyChainSpec(ComponentId chainId) { return new ChainSpecification(chainId, new ChainSpecification.Inheritance(null, null), Collections.<Phase>emptySet(), Collections.<ComponentSpecification>emptySet()); }
static ChainSpecification emptySearchChainSpecification(String componentName) { return new ChainSpecification( new ComponentId(componentName), VespaSearchChainsCreator.inheritsVespaPhases(), //TODO: refactor Collections.<Phase>emptyList(), Collections.<ComponentSpecification>emptySet()); }
public ChainSpecification addInherits(Collection<ComponentSpecification> inheritedChains) { return new ChainSpecification(componentId, inheritance.addInherits(inheritedChains), phases(), componentReferences); }
public IndexingDocprocChain() { super(new ChainSpecification(new ComponentId(NAME), new ChainSpecification.Inheritance(Collections.<ComponentSpecification>emptySet(), Collections.<ComponentSpecification>emptySet()), phases, Collections.<ComponentSpecification>emptySet()), new HashMap<>()); addInnerComponent(new IndexingProcessor()); }
@Override public ChainSpecification getChainSpecification() { ChainSpecification spec = super.getChainSpecification(); return new ChainSpecification(spec.componentId, spec.inheritance, spec.phases(), disableStemmingIfStreaming(spec.componentReferences)); }
/** * @param allChainSpecifications resolves ChainSpecifications from ComponentSpecifications * as given in the inheritance fields. * @param path tracks which chains are used in each recursive invocation of flatten, used for detecting cycles. * @return ChainSpecification directly containing all the component references and phases of the inherited chains. */ private ChainSpecification flatten(Resolver<ChainSpecification> allChainSpecifications, Deque<ComponentId> path) { path.push(componentId); //if this turns out to be a bottleneck(which I seriously doubt), please add memoization Map<String, ComponentSpecification> resultingComponents = componentsByName(componentReferences); Map<String, Phase> resultingPhases = new LinkedHashMap<>(phases); for (ComponentSpecification inheritedChainSpecification : inheritance.chainSpecifications) { ChainSpecification inheritedChain = resolveChain(path, allChainSpecifications, inheritedChainSpecification). flatten(allChainSpecifications, path); mergeInto(resultingComponents, filterByComponentSpecification( filterByName(inheritedChain.componentReferences, names(componentReferences)), inheritance.excludedComponents)); mergeInto(resultingPhases, inheritedChain.phases); } path.pop(); return new ChainSpecification(componentId, inheritance.flattened(), resultingPhases.values(), new LinkedHashSet<>(resultingComponents.values())); }
private static ChainSpecification nativeSearchChainSpecification() { return new ChainSpecification( new ComponentId("native"), inheritsVespaPhases(), noPhases(), noSearcherReferences()); }
private static ChainSpecification vespaSearchChainSpecification() { return new ChainSpecification( new ComponentId("vespa"), inherits(nativeSearchChainSpecification().componentId), noPhases(), noSearcherReferences()); }
private static ChainSpecification vespaPhasesSpecification() { return new ChainSpecification( new ComponentId("vespaPhases"), new ChainSpecification.Inheritance(null, null), PhasesCreator.linearPhases( PhaseNames.RAW_QUERY, PhaseNames.TRANSFORMED_QUERY, PhaseNames.BLENDED_RESULT, PhaseNames.UNBLENDED_RESULT, PhaseNames.BACKEND), noSearcherReferences()); }
private static ChainSpecification createChainSpecification(ChainsConfig.Chains config) { return new ChainSpecification(new ComponentId(config.id()), createInheritance(config.inherits(), config.excludes()), createPhases(config.phases()), createComponentSpecifications(config.components())); }