diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2020-01-08 23:01:46 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2020-01-08 23:01:46 +0100 |
commit | c49a1256ef4c431f7a59018e4d62d1942fdeaf1e (patch) | |
tree | 883f7411e58ffbbb09238fd95d7bf76e6076bf92 /container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java | |
parent | 93057cb2141dee8846c9304eb6a9aae2ba9c4dc0 (diff) |
Support max-hits-per-node in Dispatcher
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java b/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java index 6030e989595..1c3a90ac6ab 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/InvokerFactory.java @@ -27,7 +27,10 @@ public abstract class InvokerFactory { this.searchCluster = searchCluster; } - protected abstract Optional<SearchInvoker> createNodeSearchInvoker(VespaBackEndSearcher searcher, Query query, Node node); + protected abstract Optional<SearchInvoker> createNodeSearchInvoker(VespaBackEndSearcher searcher, + Query query, + int maxHits, + Node node); public abstract FillInvoker createFillInvoker(VespaBackEndSearcher searcher, Result result); @@ -47,13 +50,14 @@ public abstract class InvokerFactory { Query query, OptionalInt groupId, List<Node> nodes, - boolean acceptIncompleteCoverage) { + boolean acceptIncompleteCoverage, + int maxHits) { List<SearchInvoker> invokers = new ArrayList<>(nodes.size()); Set<Integer> failed = null; for (Node node : nodes) { boolean nodeAdded = false; if (node.isWorking() != Boolean.FALSE) { - Optional<SearchInvoker> invoker = createNodeSearchInvoker(searcher, query, node); + Optional<SearchInvoker> invoker = createNodeSearchInvoker(searcher, query, maxHits, node); if (invoker.isPresent()) { invokers.add(invoker.get()); nodeAdded = true; |