diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-22 12:44:40 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-23 10:01:17 +0100 |
commit | b8165e0e316527dc956489bc416f9ccb83cf1904 (patch) | |
tree | f2242e63ca98c5293768b8a5858d7f605c95d27d /container-search/src/test/java | |
parent | 8ccd836e176f4d1bea05ee835428977c50463e0e (diff) |
Only have the DispatchNodesConfig inject into one component.
Let RpcResourcePool/RpcClient be owned by the dispatcher.
Step 2 in preparing for smooth handling of content cluster changes.
Diffstat (limited to 'container-search/src/test/java')
3 files changed, 5 insertions, 5 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java index 978da396f3e..5df8d2e5444 100644 --- a/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java @@ -17,7 +17,6 @@ import com.yahoo.search.Query; import com.yahoo.search.Result; import com.yahoo.search.config.ClusterConfig; import com.yahoo.search.dispatch.Dispatcher; -import com.yahoo.search.dispatch.rpc.RpcResourcePool; import com.yahoo.search.result.Hit; import com.yahoo.search.schema.RankProfile; import com.yahoo.search.schema.Schema; @@ -451,8 +450,7 @@ public class ClusterSearcherTestCase { DispatchConfig dispatchConfig = new DispatchConfig.Builder().build(); DispatchNodesConfig nodesConfig = new DispatchNodesConfig.Builder().build(); - Dispatcher dispatcher = new Dispatcher(new RpcResourcePool(dispatchConfig, nodesConfig), - ComponentId.createAnonymousComponentId("test-id"), + Dispatcher dispatcher = new Dispatcher(ComponentId.createAnonymousComponentId("test-id"), dispatchConfig, nodesConfig, vipStatus); diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java index 2f960add4a8..be23c21eaf6 100644 --- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java @@ -13,6 +13,7 @@ import com.yahoo.prelude.fastsearch.SummaryParameters; import com.yahoo.search.Query; import com.yahoo.search.Result; import com.yahoo.search.Searcher; +import com.yahoo.search.dispatch.rpc.RpcClient; import com.yahoo.search.dispatch.rpc.RpcResourcePool; import com.yahoo.search.dispatch.searchcluster.Node; import com.yahoo.search.grouping.GroupingRequest; @@ -185,7 +186,7 @@ public class FastSearcherTestCase { b.searchcluster(searchClusterB); VipStatus vipStatus = new VipStatus(b.build()); List<Node> nodes_1 = ImmutableList.of(new Node(0, "host0", 0)); - RpcResourcePool rpcPool_1 = new RpcResourcePool(MockDispatcher.toDispatchConfig(), MockDispatcher.toNodesConfig(nodes_1)); + RpcResourcePool rpcPool_1 = new RpcResourcePool(new RpcClient("rpcclient", 1), MockDispatcher.toNodesConfig(nodes_1), 2); MockDispatcher dispatch_1 = MockDispatcher.create(nodes_1, rpcPool_1, vipStatus); dispatch_1.clusterMonitor.shutdown(); vipStatus.addToRotation(clusterName); diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/MockDispatcher.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/MockDispatcher.java index 95ecd0e5a40..974441fc5fc 100644 --- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/MockDispatcher.java +++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/MockDispatcher.java @@ -4,6 +4,7 @@ package com.yahoo.prelude.fastsearch.test; import com.yahoo.container.handler.VipStatus; import com.yahoo.search.cluster.ClusterMonitor; import com.yahoo.search.dispatch.Dispatcher; +import com.yahoo.search.dispatch.rpc.RpcClient; import com.yahoo.search.dispatch.rpc.RpcInvokerFactory; import com.yahoo.search.dispatch.rpc.RpcPingFactory; import com.yahoo.search.dispatch.rpc.RpcResourcePool; @@ -19,7 +20,7 @@ class MockDispatcher extends Dispatcher { public final ClusterMonitor clusterMonitor; public static MockDispatcher create(List<Node> nodes) { - var rpcResourcePool = new RpcResourcePool(toDispatchConfig(), toNodesConfig(nodes)); + var rpcResourcePool = new RpcResourcePool(new RpcClient("rpcclient", 1), toNodesConfig(nodes), 2); return create(nodes, rpcResourcePool, new VipStatus()); } |