use of com.yahoo.search.searchchain.model.federation.FederationSearcherModel.TargetSpec in project vespa by vespa-engine.
the class FederationSearcher method addDefaultTargets.
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);
}
}
use of com.yahoo.search.searchchain.model.federation.FederationSearcherModel.TargetSpec in project vespa by vespa-engine.
the class FederationSearcher method addSourceTargets.
private void addSourceTargets(TargetResolver targetResolver, List<TargetSpec> targets) {
for (TargetSpec targetSpec : targets) {
Target target = targetResolver.resolve(targetSpec);
if (target == null) {
throw new RuntimeException("Can't find source " + targetSpec.sourceSpec + " used as a source for federation '" + getComponentId() + "'");
}
Target duplicate = resolvedTargets.put(target.id, target);
if (duplicate != null && !duplicate.targetOptions.equals(target.targetOptions)) {
throw new RuntimeException("Search chain " + target.id + " added twice with different federation options" + " to the federation searcher " + getComponentId());
}
}
}
Aggregations