diff options
Diffstat (limited to 'container-search/src/test/java')
5 files changed, 17 insertions, 15 deletions
diff --git a/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java b/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java index 858f0afc8e9..16d253d1484 100644 --- a/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java +++ b/container-search/src/test/java/com/yahoo/fs4/mplex/BackendTestCase.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.fs4.mplex; +import com.yahoo.container.QrConfig; import com.yahoo.container.search.Fs4Config; import com.yahoo.fs4.BasicPacket; import com.yahoo.fs4.ChannelTimeoutException; @@ -143,7 +144,7 @@ public class BackendTestCase { logger = Logger.getLogger(Backend.class.getName()); initUseParent = logger.getUseParentHandlers(); logger.setUseParentHandlers(false); - listeners = new FS4ResourcePool(new Fs4Config(new Fs4Config.Builder())); + listeners = new FS4ResourcePool(new Fs4Config(new Fs4Config.Builder()), new QrConfig(new QrConfig.Builder())); server = new MockServer(); backend = listeners.getBackend(server.host.getHostString(), server.host.getPort()); 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 116bab43645..6443cbdf163 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 @@ -3,6 +3,7 @@ package com.yahoo.prelude.cluster; import com.yahoo.cloud.config.ClusterInfoConfig; import com.yahoo.component.ComponentId; +import com.yahoo.container.QrConfig; import com.yahoo.container.QrSearchersConfig; import com.yahoo.container.search.Fs4Config; import com.yahoo.container.search.LegacyEmulationConfig; @@ -533,7 +534,7 @@ public class ClusterSearcherTestCase { QrMonitorConfig monitorCfg = new QrMonitorConfig(new QrMonitorConfig.Builder()); Statistics statistics = Statistics.nullImplementation; Fs4Config fs4Cfg = new Fs4Config(new Fs4Config.Builder()); - FS4ResourcePool fs4ResourcePool = new FS4ResourcePool(fs4Cfg); + FS4ResourcePool fs4ResourcePool = new FS4ResourcePool(fs4Cfg, new QrConfig(new QrConfig.Builder())); ClusterSearcher searcher = new ClusterSearcher(id, qrsCfg, clusterCfg, documentDbCfg, emulationCfg, monitorCfg, new DispatchConfig(new DispatchConfig.Builder()), createClusterInfoConfig(), 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 3b8155efc95..f17f02ca27d 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 @@ -4,6 +4,7 @@ package com.yahoo.prelude.fastsearch.test; import com.google.common.collect.ImmutableList; import com.yahoo.component.chain.Chain; import com.yahoo.config.subscription.ConfigGetter; +import com.yahoo.container.QrConfig; import com.yahoo.container.handler.VipStatus; import com.yahoo.container.protect.Error; import com.yahoo.container.search.Fs4Config; @@ -82,7 +83,7 @@ public class FastSearcherTestCase { public void testNoNormalizing() { Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); FastSearcher fastSearcher = new FastSearcher(new MockBackend(), - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -103,7 +104,7 @@ public class FastSearcherTestCase { public void testNullQuery() { Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); FastSearcher fastSearcher = new FastSearcher(new MockBackend(), - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -176,7 +177,7 @@ public class FastSearcherTestCase { DocumentdbInfoConfig documentdbConfigWithOneDb = new DocumentdbInfoConfig(new DocumentdbInfoConfig.Builder().documentdb(new DocumentdbInfoConfig.Documentdb.Builder().name("testDb"))); FastSearcher fastSearcher = new FastSearcher(mockBackend, - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -368,7 +369,7 @@ public class FastSearcherTestCase { MockFSChannel.resetDocstamp(); Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); return new FastSearcher(mockBackend, - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -381,7 +382,7 @@ public class FastSearcherTestCase { Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); MockFSChannel.resetDocstamp(); FastSearcher fastSearcher = new FastSearcher(new MockBackend(), - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -424,7 +425,7 @@ public class FastSearcherTestCase { Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); MockFSChannel.resetDocstamp(); FastSearcher fastSearcher = new FastSearcher(new MockBackend(), - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -455,7 +456,7 @@ public class FastSearcherTestCase { @Test public void testSinglePassGroupingIsForcedWithSingleNodeGroups() { FastSearcher fastSearcher = new FastSearcher(new MockBackend(), - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher(new Node(0, "host0", 123, 0)), new SummaryParameters(null), new ClusterParams("testhittype"), @@ -483,7 +484,7 @@ public class FastSearcherTestCase { new Node(2, "host1", 123, 0))); FastSearcher fastSearcher = new FastSearcher(new MockBackend(), - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), dispatcher, new SummaryParameters(null), new ClusterParams("testhittype"), @@ -520,10 +521,10 @@ public class FastSearcherTestCase { public void testPing() throws IOException, InterruptedException { Logger.getLogger(FastSearcher.class.getName()).setLevel(Level.ALL); BackendTestCase.MockServer server = new BackendTestCase.MockServer(); - FS4ResourcePool listeners = new FS4ResourcePool(new Fs4Config(new Fs4Config.Builder())); + FS4ResourcePool listeners = new FS4ResourcePool(new Fs4Config(new Fs4Config.Builder()), new QrConfig(new QrConfig.Builder())); Backend backend = listeners.getBackend(server.host.getHostString(),server.host.getPort()); FastSearcher fastSearcher = new FastSearcher(backend, - new FS4ResourcePool(1), + new FS4ResourcePool("container.0", 1), new MockDispatcher("a", Collections.emptyList()), new SummaryParameters(null), new ClusterParams("testhittype"), 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 1cd2c4ae791..001c8d57759 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 @@ -18,7 +18,7 @@ class MockDispatcher extends Dispatcher { } public MockDispatcher(String clusterId, List<Node> nodes) { - this(clusterId, nodes, new FS4ResourcePool(1), 1, new VipStatus()); + this(clusterId, nodes, new FS4ResourcePool("container.0", 1), 1, new VipStatus()); } public MockDispatcher(String clusterId, List<Node> nodes, FS4ResourcePool fs4ResourcePool, diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/fs4mock/MockFS4ResourcePool.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/fs4mock/MockFS4ResourcePool.java index 7bb161acc07..0d756cbeff3 100644 --- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/fs4mock/MockFS4ResourcePool.java +++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/fs4mock/MockFS4ResourcePool.java @@ -7,7 +7,6 @@ import com.yahoo.prelude.fastsearch.FS4ResourcePool; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Optional; import java.util.Set; /** @@ -21,7 +20,7 @@ public class MockFS4ResourcePool extends FS4ResourcePool { private final long testingThreadId; public MockFS4ResourcePool() { - super(1); + super("container.0", 1); this.testingThreadId = Thread.currentThread().getId(); } |