aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-09-16 16:36:44 +0200
committerGitHub <noreply@github.com>2019-09-16 16:36:44 +0200
commit49a8abb5663a152df0cd97264bc9771c72cde0e2 (patch)
tree19b894a1ff82cf06b0add35772f3caf2d9057d7d /container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java
parenta30ea6f8527a5d5cfacf84d4a576929b91d83153 (diff)
Revert "Use a LeanHit until merging is done."
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java b/container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java
index 77b3df7c83a..3bfb9089457 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/SearchInvoker.java
@@ -32,15 +32,14 @@ public abstract class SearchInvoker extends CloseableInvoker {
*/
public Result search(Query query, Execution execution) throws IOException {
sendSearchRequest(query);
- InvokerResult result = getSearchResult(execution);
- setFinalStatus(result.getResult().hits().getError() == null);
- result.complete();
- return result.getResult();
+ Result result = getSearchResult(execution);
+ setFinalStatus(result.hits().getError() == null);
+ return result;
}
protected abstract void sendSearchRequest(Query query) throws IOException;
- protected abstract InvokerResult getSearchResult(Execution execution) throws IOException;
+ protected abstract Result getSearchResult(Execution execution) throws IOException;
protected void setMonitor(ResponseMonitor<SearchInvoker> monitor) {
this.monitor = monitor;
@@ -56,12 +55,12 @@ public abstract class SearchInvoker extends CloseableInvoker {
return node.map(Node::key);
}
- protected InvokerResult errorResult(Query query, ErrorMessage errorMessage) {
+ protected Result errorResult(Query query, ErrorMessage errorMessage) {
Result error = new Result(query, errorMessage);
Coverage errorCoverage = new Coverage(0, 0, 0);
errorCoverage.setNodesTried(1);
error.setCoverage(errorCoverage);
- return new InvokerResult(error);
+ return error;
}
}