public BundleInstantiationSpecification(ComponentId id, ComponentSpecification classId, ComponentSpecification bundle) { this(id.toSpecification(), classId, bundle); assert (classId!= null); }
private static ChainSpecification.Inheritance inherits(ComponentId chainId) { Set<ComponentSpecification> inheritsSet = new LinkedHashSet<>(); inheritsSet.add(chainId.toSpecification()); return new ChainSpecification.Inheritance(inheritsSet, null); }
/** Set the desired format for result rendering. If null, use the default renderer. */ public void setRenderer(@Nullable ComponentSpecification format) { this.format = (format != null) ? format : RendererRegistry.defaultRendererId.toSpecification(); }
/** Must be called when use of this is discontinued to free the resources it has allocated */ public void deconstruct() { // deconstruct the renderers which was created by this getRenderer(jsonRendererId.toSpecification()).deconstruct(); getRenderer(xmlRendererId.toSpecification()).deconstruct(); getRenderer(pageRendererId.toSpecification()).deconstruct(); }
private Set<ComponentSpecification> disableStemmingIfStreaming(Set<ComponentSpecification> searcherReferences) { if (!searchCluster.isStreaming()) { return searcherReferences; } else { Set<ComponentSpecification> filteredSearcherReferences = new LinkedHashSet<>(searcherReferences); filteredSearcherReferences.remove( toGlobalComponentId( new ComponentId("com.yahoo.prelude.querytransform.StemmingSearcher")). toSpecification()); return filteredSearcherReferences; } }
public ChainSpecification getChainSpecification() { Collection<ComponentSpecification> innerComponentSpecifications = new ArrayList<>(); for (ChainedComponent innerComponent : getInnerComponents()) { innerComponentSpecifications.add(innerComponent.getGlobalComponentId().toSpecification()); } return specWithoutInnerComponents. addComponents(innerComponentSpecifications). setComponentId(getGlobalComponentId()); }
@Override public ChainSpecification getChainSpecification() { return super.getChainSpecification().addInherits( Arrays.asList(getParentProvider().getComponentId().toSpecification())); }
private static <COMPONENT extends ChainedComponent> void initDependencies( ChainsModel model, ComponentRegistry<COMPONENT> allComponents) { for (ChainedComponentModel componentModel : model.allComponents()) { COMPONENT component = getComponentOrThrow(allComponents, componentModel.getComponentId().toSpecification()); component.initDependencies(componentModel.dependencies); } }
private void addDefaultTargets(TargetResolver targetResolver, ComponentRegistry<SearchChain> searchChainRegistry) { for (GenericTarget genericTarget : defaultTargets(searchChainRegistry.allComponents())) { ComponentSpecification specification = genericTarget.getComponentId().toSpecification(); //Can't use genericTarget directly, as it might be part of a source group. Target federationTarget = targetResolver.resolve(new TargetSpec(specification, new FederationOptions())); //Do not replace manually added sources, as they might have manually configured federation options if (!resolvedTargets.containsKey(federationTarget.id)) resolvedTargets.put(federationTarget.id, federationTarget); } }