diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-03-07 11:07:22 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-03-07 11:07:22 +0100 |
commit | 584dcf0b4a54b5e5a70696c15ee0c2bfe63ab656 (patch) | |
tree | f89a0e42cf7578c5dfac967ad955db2209384b5b | |
parent | dde5f15de9f58a95acaa99b78dbd3a6d30937600 (diff) |
Nonfunctional changes only
6 files changed, 23 insertions, 16 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java index 6ce08c75dd4..697cf910719 100644 --- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java @@ -330,14 +330,12 @@ public class FastSearcher extends VespaBackEndSearcher { result.hits().addError(ErrorMessage.createBackendCommunicationError("Error filling hits with summary fields, source: " + getName())); return; } - if (skippedHits==0 && packetWrapper != null) { + if (skippedHits == 0 && packetWrapper != null) { cacheControl.updateCacheEntry(cacheKey, query, packetKeys, receivedPackets); } - if ( skippedHits>0 ) { - getLogger().info("Could not fill summary '" + summaryClass + "' for " + skippedHits + " hits for query: " + result.getQuery()); + if ( skippedHits > 0 ) result.hits().addError(com.yahoo.search.result.ErrorMessage.createEmptyDocsums("Missing hit data for summary '" + summaryClass + "' for " + skippedHits + " hits")); - } result.analyzeHits(); if (query.getTraceLevel() >= 3) { diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java index 7a390ac279b..c61b043a36b 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java @@ -245,7 +245,7 @@ public class Dispatcher extends AbstractComponent { } Inspector summaries = new SlimeAdapter(root.field("docsums")); - if ( ! summaries.valid() && !hasErrors) + if ( ! summaries.valid() && ! hasErrors) throw new IllegalArgumentException("Expected a Slime root object containing a 'docsums' field"); for (int i = 0; i < hits.size(); i++) { fill(hits.get(i), summaries.entry(i).field("docsum")); diff --git a/container-search/src/main/java/com/yahoo/search/federation/sourceref/SourceRefResolver.java b/container-search/src/main/java/com/yahoo/search/federation/sourceref/SourceRefResolver.java index f690ad10050..e14c46056b7 100644 --- a/container-search/src/main/java/com/yahoo/search/federation/sourceref/SourceRefResolver.java +++ b/container-search/src/main/java/com/yahoo/search/federation/sourceref/SourceRefResolver.java @@ -18,13 +18,15 @@ import com.yahoo.processing.request.Properties; * @author tonytv */ public class SourceRefResolver { + private final SearchChainResolver searchChainResolver; public SourceRefResolver(SearchChainResolver searchChainResolver) { this.searchChainResolver = searchChainResolver; } - public Set<SearchChainInvocationSpec> resolve(ComponentSpecification sourceRef, Properties sourceToProviderMap, - IndexFacts indexFacts) + public Set<SearchChainInvocationSpec> resolve(ComponentSpecification sourceRef, + Properties sourceToProviderMap, + IndexFacts indexFacts) throws UnresolvedSearchChainException { try { @@ -47,7 +49,7 @@ public class SourceRefResolver { clusterSearchChains.add(resolveClusterSearchChain(cluster, sourceRef, sourceToProviderMap)); } - if (!clusterSearchChains.isEmpty()) + if ( ! clusterSearchChains.isEmpty()) return clusterSearchChains; } @@ -55,17 +57,22 @@ public class SourceRefResolver { } - private SearchChainInvocationSpec resolveClusterSearchChain(String cluster, ComponentSpecification sourceRef, - Properties sourceToProviderMap) throws UnresolvedSearchChainException { + private SearchChainInvocationSpec resolveClusterSearchChain(String cluster, + ComponentSpecification sourceRef, + Properties sourceToProviderMap) + throws UnresolvedSearchChainException { try { return searchChainResolver.resolve(new ComponentSpecification(cluster), sourceToProviderMap); - } catch (UnresolvedSearchChainException e) { + } + catch (UnresolvedSearchChainException e) { throw new UnresolvedSearchChainException("Failed to resolve cluster search chain " + quote(cluster) + - " when using source ref " + quote(sourceRef) + " as a document name."); + " when using source ref " + quote(sourceRef) + + " as a document name."); } } private boolean hasOnlyName(ComponentSpecification sourceSpec) { return new ComponentSpecification(sourceSpec.getName()).equals(sourceSpec); } + } diff --git a/container-search/src/main/java/com/yahoo/search/federation/sourceref/Target.java b/container-search/src/main/java/com/yahoo/search/federation/sourceref/Target.java index 79b5d5bc67e..cf7276d767e 100644 --- a/container-search/src/main/java/com/yahoo/search/federation/sourceref/Target.java +++ b/container-search/src/main/java/com/yahoo/search/federation/sourceref/Target.java @@ -8,9 +8,10 @@ import com.yahoo.processing.request.Properties; /** * TODO: What's this? * -* @author tonytv -*/ + * @author tonytv + */ public abstract class Target extends AbstractComponent { + final ComponentId localId; final boolean isDerived; @@ -28,4 +29,5 @@ public abstract class Target extends AbstractComponent { public abstract String searchRefDescription(); abstract void freeze(); + } diff --git a/document/src/main/java/com/yahoo/document/annotation/AnnotationTypes.java b/document/src/main/java/com/yahoo/document/annotation/AnnotationTypes.java index e1e61e13119..248e37345a8 100644 --- a/document/src/main/java/com/yahoo/document/annotation/AnnotationTypes.java +++ b/document/src/main/java/com/yahoo/document/annotation/AnnotationTypes.java @@ -10,7 +10,7 @@ import java.util.List; * This is a container for all {@link Annotation}s constants used by built-in Vespa features. These must be in sync with * the corresponding class in the C++ file 'document/datatype/annotationtype.h'. * - * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a> + * @author Simon Thoresen */ @SuppressWarnings({ "UnusedDeclaration" }) public final class AnnotationTypes { diff --git a/document/src/main/java/com/yahoo/document/annotation/SpanTrees.java b/document/src/main/java/com/yahoo/document/annotation/SpanTrees.java index ff9c8c07a47..64d7d7cff68 100644 --- a/document/src/main/java/com/yahoo/document/annotation/SpanTrees.java +++ b/document/src/main/java/com/yahoo/document/annotation/SpanTrees.java @@ -4,7 +4,7 @@ package com.yahoo.document.annotation; /** * This is a container for all {@link SpanTree}s constants used by built-in Vespa features. * - * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a> + * @author Simon Thoresen */ @SuppressWarnings({ "UnusedDeclaration" }) // TODO: Remove. This is the wrong place. |