diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-09-19 07:50:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-19 07:50:08 +0200 |
commit | 3c6887a27a5acafbbcb8d2b42dbb0c02caf1308b (patch) | |
tree | 8912305cc454b70a3beefccf3a8c36ea47f5ed46 /container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java | |
parent | b6f507c1ff4f73ebabacdcf0a434317011dfdafe (diff) |
Revert "Revert "Revert "Revert "Revert "Revert "Balder/no more fs4 dispatching from fastsearcher"""".""
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java index 6146751f35f..d9a76965c3e 100644 --- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java +++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java @@ -45,15 +45,12 @@ public class RpcInvokerFactory extends InvokerFactory implements PingFactory { Query query = result.getQuery(); boolean summaryNeedsQuery = searcher.summaryNeedsQuery(query); + boolean useProtoBuf = query.properties().getBoolean(Dispatcher.dispatchProtobuf, dispatchWithProtobuf); + boolean useDispatchDotSummaries = query.properties().getBoolean(dispatchSummaries, false); - if(query.properties().getBoolean(Dispatcher.dispatchProtobuf, dispatchWithProtobuf)) { - return Optional.of(new RpcProtobufFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query), searcher.getServerId(), summaryNeedsQuery)); - } - if (query.properties().getBoolean(dispatchSummaries, true) && ! summaryNeedsQuery) { - return Optional.of(new RpcFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query))); - } else { - return Optional.empty(); - } + return ((useDispatchDotSummaries || !useProtoBuf) && ! summaryNeedsQuery) + ? Optional.of(new RpcFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query))) + : Optional.of(new RpcProtobufFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query), searcher.getServerId(), summaryNeedsQuery)); } // for testing |