diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-10-25 13:33:09 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-10-25 13:33:09 +0200 |
commit | cc7153b5c502bfdfa9603182cfe6848f955075de (patch) | |
tree | 2da646cad6d24c5c4c35ef26d6ac1a1940897169 /container-search/src/test/java/com/yahoo/search/dispatch | |
parent | 0087412bb6e46c06ba66705a11121f522f0bfc02 (diff) |
Create one Dispatcher component per search cluster
This avoids creating an excessive number of connections
to search clusters when the application (incorrectly) creates
many local provider chains to the same search cluster.
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/dispatch')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java b/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java index 3d544f5c114..30f6c5a495d 100644 --- a/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java +++ b/container-search/src/test/java/com/yahoo/search/dispatch/DispatcherTest.java @@ -38,14 +38,12 @@ public class DispatcherTest { @Test public void requireDispatcherToIgnoreMultilevelConfigurations() { - SearchCluster cl = new MockSearchCluster("1", 2, 2); - DispatchConfig.Builder builder = new DispatchConfig.Builder(); - builder.useMultilevelDispatch(true); - DispatchConfig dc = new DispatchConfig(builder); + SearchCluster searchCluster = new MockSearchCluster("1", 2, 2); + DispatchConfig dispatchConfig = new DispatchConfig.Builder().useMultilevelDispatch(true).build(); - var invokerFactory = new MockInvokerFactory(cl); + var invokerFactory = new MockInvokerFactory(searchCluster); - Dispatcher disp = new Dispatcher(cl, dc, invokerFactory, invokerFactory, new MockMetric()); + Dispatcher disp = new Dispatcher(searchCluster, dispatchConfig, invokerFactory, invokerFactory, new MockMetric()); assertThat(disp.getSearchInvoker(query(), null).isPresent(), is(false)); } @@ -113,6 +111,7 @@ public class DispatcherTest { } private static class MockInvokerFactory extends InvokerFactory implements PingFactory { + private final FactoryStep[] events; private int step = 0; |