aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/dispatch
diff options
context:
space:
mode:
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.java21
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/InterleavedSearchInvokerTest.java32
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/MockInvoker.java2
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/rpc/RpcSearchInvokerTest.java12
4 files changed, 33 insertions, 34 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 8dc74110291..c966fbc200d 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
@@ -3,7 +3,7 @@ package com.yahoo.search.dispatch;
import com.yahoo.compress.CompressionType;
import com.yahoo.prelude.Pong;
-import com.yahoo.prelude.fastsearch.VespaBackEndSearcher;
+import com.yahoo.prelude.fastsearch.VespaBackend;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.cluster.ClusterMonitor;
@@ -18,7 +18,6 @@ import com.yahoo.search.dispatch.searchcluster.Pinger;
import com.yahoo.search.dispatch.searchcluster.PongHandler;
import com.yahoo.search.dispatch.searchcluster.SearchCluster;
import com.yahoo.search.dispatch.searchcluster.SearchGroups;
-import com.yahoo.search.searchchain.Execution;
import com.yahoo.vespa.config.search.DispatchConfig;
import com.yahoo.vespa.config.search.DispatchNodesConfig;
import com.yahoo.yolean.UncheckedInterruptedException;
@@ -237,19 +236,19 @@ public class DispatcherTest {
// This factory just forwards search to the dummy RPC layer above, nothing more.
InvokerFactoryFactory invokerFactories = (rpcConnectionPool, searchGroups, dispatchConfig) -> new InvokerFactory(searchGroups, dispatchConfig) {
- @Override protected Optional<SearchInvoker> createNodeSearchInvoker(VespaBackEndSearcher searcher, Query query, int maxHits, Node node) {
+ @Override protected Optional<SearchInvoker> createNodeSearchInvoker(VespaBackend searcher, Query query, int maxHits, Node node) {
return Optional.of(new SearchInvoker(Optional.of(node)) {
@Override protected Object sendSearchRequest(Query query, Object context) {
rpcPool.getConnection(node.key()).request(null, null, 0, null, null, 0);
return null;
};
- @Override protected InvokerResult getSearchResult(Execution execution) {
+ @Override protected InvokerResult getSearchResult() {
return new InvokerResult(new Result(new Query()));
}
@Override protected void release() { }
});
};
- @Override public FillInvoker createFillInvoker(VespaBackEndSearcher searcher, Result result) {
+ @Override public FillInvoker createFillInvoker(VespaBackend searcher, Result result) {
return new FillInvoker() {
@Override protected void getFillResults(Result result, String summaryClass) { fail(); }
@Override protected void sendFillRequest(Result result, String summaryClass) { fail(); }
@@ -288,11 +287,11 @@ public class DispatcherTest {
// Start some searches, one against each group, since we have a round-robin policy.
SearchInvoker search0 = dispatcher.getSearchInvoker(new Query(), null);
- search0.search(new Query(), null);
+ search0.search(new Query());
// Unknown whether the first or second search hits node0, so we must track that.
int offset = nodeIdOfSearcher0.get();
SearchInvoker search1 = dispatcher.getSearchInvoker(new Query(), null);
- search1.search(new Query(), null);
+ search1.search(new Query());
// Wait for the current cluster monitor to be mid-ping-round.
doPing.set(true);
@@ -330,7 +329,7 @@ public class DispatcherTest {
// Next search should hit group0 again, this time on node2.
SearchInvoker search2 = dispatcher.getSearchInvoker(new Query(), null);
- search2.search(new Query(), null);
+ search2.search(new Query());
// Searches against nodes 1 and 2 complete.
(offset == 0 ? search0 : search1).close();
@@ -370,7 +369,7 @@ public class DispatcherTest {
}
@Override
- public Optional<SearchInvoker> createSearchInvoker(VespaBackEndSearcher searcher,
+ public Optional<SearchInvoker> createSearchInvoker(VespaBackend searcher,
Query query,
List<Node> nodes,
boolean acceptIncompleteCoverage,
@@ -392,7 +391,7 @@ public class DispatcherTest {
}
@Override
- protected Optional<SearchInvoker> createNodeSearchInvoker(VespaBackEndSearcher searcher,
+ protected Optional<SearchInvoker> createNodeSearchInvoker(VespaBackend searcher,
Query query,
int maxHitsPerNode,
Node node) {
@@ -401,7 +400,7 @@ public class DispatcherTest {
}
@Override
- public FillInvoker createFillInvoker(VespaBackEndSearcher searcher, Result result) {
+ public FillInvoker createFillInvoker(VespaBackend searcher, Result result) {
fail("Unexpected call to createFillInvoker");
return null;
}
diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/InterleavedSearchInvokerTest.java b/container-search/src/test/java/com/yahoo/search/dispatch/InterleavedSearchInvokerTest.java
index fac75b1dd68..8ced7d3895e 100644
--- a/container-search/src/test/java/com/yahoo/search/dispatch/InterleavedSearchInvokerTest.java
+++ b/container-search/src/test/java/com/yahoo/search/dispatch/InterleavedSearchInvokerTest.java
@@ -61,7 +61,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(4900, 100, 1));
expectedEvents.add(new Event(4800, 100, 2));
- invoker.search(query, null);
+ invoker.search(query);
assertTrue(expectedEvents.isEmpty(), "All test scenario events processed");
}
@@ -75,7 +75,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(4700, 300, 1));
expectedEvents.add(null);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertTrue(expectedEvents.isEmpty(), "All test scenario events processed");
assertNull(result.hits().getErrorHit(), "Result is not marked as an error");
@@ -94,7 +94,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(2400, 100, 2));
expectedEvents.add(new Event(0, 0, null));
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertTrue(expectedEvents.isEmpty(), "All test scenario events processed");
assertNull(result.hits().getErrorHit(), "Result is not marked as an error");
@@ -113,7 +113,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(new Event(null, 200, 1));
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
Coverage cov = result.getCoverage(true);
assertEquals(100000L, cov.getDocs());
@@ -134,7 +134,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(new Event(null, 200, 1));
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
Coverage cov = result.getCoverage(true);
assertEquals(23420L, cov.getDocs());
@@ -156,7 +156,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(new Event(null, 200, 1));
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
Coverage cov = result.getCoverage(true);
assertEquals(9900L, cov.getDocs());
@@ -178,7 +178,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(null);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
Coverage cov = result.getCoverage(true);
assertEquals(50155L, cov.getDocs());
@@ -213,7 +213,7 @@ public class InterleavedSearchInvokerTest {
query.setHits(8);
query.properties().set(Dispatcher.topKProbability, topKProbability);
SearchInvoker[] invokers = invoker.invokers().toArray(new SearchInvoker[0]);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(2, invokers.length);
assertEquals(expectedK, ((MockInvoker) invokers[0]).hitsRequested);
assertEquals(8, result.hits().size());
@@ -264,7 +264,7 @@ public class InterleavedSearchInvokerTest {
void requireThatMergeOfConcreteHitsObeySorting() throws IOException {
try (InterleavedSearchInvoker invoker = createInterLeavedTestInvoker(A5, B5, new Group(0, List.of()))) {
query.setHits(12);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(10, result.hits().size());
assertEquals(11.0, result.hits().get(0).getRelevance().getScore(), DELTA);
assertEquals(1.0, result.hits().get(9).getRelevance().getScore(), DELTA);
@@ -273,7 +273,7 @@ public class InterleavedSearchInvokerTest {
}
try ( InterleavedSearchInvoker invoker = createInterLeavedTestInvoker(B5, A5, new Group(0, List.of()))) {
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(10, result.hits().size());
assertEquals(11.0, result.hits().get(0).getRelevance().getScore(), DELTA);
assertEquals(1.0, result.hits().get(9).getRelevance().getScore(), DELTA);
@@ -287,7 +287,7 @@ public class InterleavedSearchInvokerTest {
try (InterleavedSearchInvoker invoker = createInterLeavedTestInvoker(A5, B5, new Group(0, List.of()))) {
query.setHits(3);
query.setOffset(5);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(3, result.hits().size());
assertEquals(7.0, result.hits().get(0).getRelevance().getScore(), DELTA);
assertEquals(3.0, result.hits().get(2).getRelevance().getScore(), DELTA);
@@ -297,7 +297,7 @@ public class InterleavedSearchInvokerTest {
try (InterleavedSearchInvoker invoker = createInterLeavedTestInvoker(B5, A5, new Group(0, List.of()))) {
query.setOffset(5);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(3, result.hits().size());
assertEquals(7.0, result.hits().get(0).getRelevance().getScore(), DELTA);
assertEquals(3.0, result.hits().get(2).getRelevance().getScore(), DELTA);
@@ -311,7 +311,7 @@ public class InterleavedSearchInvokerTest {
try (InterleavedSearchInvoker invoker = createInterLeavedTestInvoker(A5Aux, B5Aux, new Group(0, List.of()))) {
query.setHits(3);
query.setOffset(5);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(7, result.hits().size());
assertEquals(7.0, result.hits().get(0).getRelevance().getScore(), DELTA);
assertEquals(3.0, result.hits().get(2).getRelevance().getScore(), DELTA);
@@ -322,7 +322,7 @@ public class InterleavedSearchInvokerTest {
try (InterleavedSearchInvoker invoker = createInterLeavedTestInvoker(B5Aux, A5Aux, new Group(0, List.of()))) {
query.setOffset(5);
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(7, result.hits().size());
assertEquals(7.0, result.hits().get(0).getRelevance().getScore(), DELTA);
assertEquals(3.0, result.hits().get(2).getRelevance().getScore(), DELTA);
@@ -359,7 +359,7 @@ public class InterleavedSearchInvokerTest {
try (InterleavedSearchInvoker invoker = new InterleavedSearchInvoker(Timer.monotonic, invokers, hitEstimator, dispatchConfig, new Group(0, List.of()), Collections.emptySet())) {
invoker.responseAvailable(invokers.get(0));
invoker.responseAvailable(invokers.get(1));
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
assertEquals(1, ((GroupingListHit) result.hits().get(0)).getGroupingList().size());
}
for (SearchInvoker invoker : invokers) {
@@ -404,7 +404,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 1, 1));
expectedEvents.add(new Event(null, 100, 0));
- Result result = invoker.search(query, null);
+ Result result = invoker.search(query);
Coverage cov = result.getCoverage(true);
assertEquals(50155L, cov.getDocs());
diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/MockInvoker.java b/container-search/src/test/java/com/yahoo/search/dispatch/MockInvoker.java
index a1521a88fb7..e43f3b0bd9a 100644
--- a/container-search/src/test/java/com/yahoo/search/dispatch/MockInvoker.java
+++ b/container-search/src/test/java/com/yahoo/search/dispatch/MockInvoker.java
@@ -40,7 +40,7 @@ class MockInvoker extends SearchInvoker {
}
@Override
- protected InvokerResult getSearchResult(Execution execution) {
+ protected InvokerResult getSearchResult() {
InvokerResult ret = new InvokerResult(query, 10);
if (coverage != null) {
ret.getResult().setCoverage(coverage);
diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/rpc/RpcSearchInvokerTest.java b/container-search/src/test/java/com/yahoo/search/dispatch/rpc/RpcSearchInvokerTest.java
index 3f527f34f31..b6fa385cfae 100644
--- a/container-search/src/test/java/com/yahoo/search/dispatch/rpc/RpcSearchInvokerTest.java
+++ b/container-search/src/test/java/com/yahoo/search/dispatch/rpc/RpcSearchInvokerTest.java
@@ -5,11 +5,11 @@ package com.yahoo.search.dispatch.rpc;
import ai.vespa.searchlib.searchprotocol.protobuf.SearchProtocol;
import com.google.common.collect.ImmutableMap;
import com.yahoo.compress.CompressionType;
-import com.yahoo.prelude.fastsearch.VespaBackEndSearcher;
+import com.yahoo.prelude.fastsearch.ClusterParams;
+import com.yahoo.prelude.fastsearch.VespaBackend;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.dispatch.searchcluster.Node;
-import com.yahoo.search.searchchain.Execution;
import org.junit.jupiter.api.Test;
import java.io.IOException;
@@ -45,7 +45,7 @@ public class RpcSearchInvokerTest {
assertEquals(10, request.getHits());
assertEquals(3, request.getOffset());
- assertTrue(request.getQueryTreeBlob().size() > 0);
+ assertFalse(request.getQueryTreeBlob().isEmpty());
var invoker2 = new RpcSearchInvoker(mockSearcher(), compressor, new Node("test", 8, "eight", 1), mockPool, 1000);
RpcSearchInvoker.RpcContext context2 = (RpcSearchInvoker.RpcContext) invoker2.sendSearchRequest(q, context);
@@ -118,10 +118,10 @@ public class RpcSearchInvokerTest {
};
}
- private VespaBackEndSearcher mockSearcher() {
- return new VespaBackEndSearcher() {
+ private VespaBackend mockSearcher() {
+ return new VespaBackend(new ClusterParams("container.0")) {
@Override
- protected Result doSearch2(Query query, Execution execution) {
+ protected Result doSearch2(String schema, Query query) {
fail("Unexpected call");
return null;
}