diff options
author | Olli Virtanen <olli.virtanen@oath.com> | 2019-05-28 14:29:29 +0200 |
---|---|---|
committer | Olli Virtanen <olli.virtanen@oath.com> | 2019-05-28 14:29:29 +0200 |
commit | 61ef8a814998a1ea0b98ecfc1ef7e830f9d1776c (patch) | |
tree | 2e540320e29b9566b07ea68605fad9ce895028ab /container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java | |
parent | df0d8f4a1a42cb0d6fa45cf059b0d63f915f2230 (diff) |
Java dispatcher only uses RPC/protobuf
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/fastsearch/FastSearcher.java | 11 |
1 files changed, 8 insertions, 3 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 5f6d4220dd4..0c8ebd70b5e 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 @@ -5,7 +5,6 @@ import com.yahoo.fs4.BasicPacket; import com.yahoo.fs4.ChannelTimeoutException; import com.yahoo.fs4.PingPacket; import com.yahoo.fs4.PongPacket; -import com.yahoo.fs4.QueryPacket; import com.yahoo.fs4.mplex.Backend; import com.yahoo.fs4.mplex.FS4Channel; import com.yahoo.fs4.mplex.InvalidChannelException; @@ -53,6 +52,7 @@ public class FastSearcher extends VespaBackEndSearcher { private final Dispatcher dispatcher; private final Backend dispatchBackend; + private final FS4ResourcePool fs4ResourcePool; /** * Creates a Fastsearcher. @@ -75,6 +75,7 @@ public class FastSearcher extends VespaBackEndSearcher { init(fs4ResourcePool.getServerId(), docSumParams, clusterParams, documentdbInfoConfig); this.dispatchBackend = dispatchBackend; this.dispatcher = dispatcher; + this.fs4ResourcePool = fs4ResourcePool; } /** @@ -213,7 +214,9 @@ public class FastSearcher extends VespaBackEndSearcher { Optional<Node> direct = getDirectNode(query); if(direct.isPresent()) { - return dispatcher.getFS4InvokerFactory().createDirectSearchInvoker(this, query, direct.get()); + var node = direct.get(); + Backend backend = fs4ResourcePool.getBackend(node.hostname(), node.fs4port()); + return new FS4SearchInvoker(this, query, backend.openChannel(), direct); } return new FS4SearchInvoker(this, query, dispatchBackend.openChannel(), Optional.empty()); } @@ -232,7 +235,9 @@ public class FastSearcher extends VespaBackEndSearcher { Optional<Node> direct = getDirectNode(query); if (direct.isPresent()) { - return dispatcher.getFS4InvokerFactory().createFillInvoker(this, result, direct.get()); + var node = direct.get(); + Backend backend = fs4ResourcePool.getBackend(node.hostname(), node.fs4port()); + return new FS4FillInvoker(this, query, backend); } return new FS4FillInvoker(this, query, dispatchBackend); } |