aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java
diff options
context:
space:
mode:
authorOlli Virtanen <olli.virtanen@oath.com>2019-04-02 11:47:20 +0200
committerOlli Virtanen <olli.virtanen@oath.com>2019-04-02 11:47:20 +0200
commit0537fc5024145cf383f9c76039cd26d739df8462 (patch)
treec96ef31e79cdf38966b0850ec6ad0a2ca00e238b /container-search/src/test/java
parente680e17b11b01ef67b96957fe852e3de5cbc050b (diff)
Use sort data with java dispatcher
Diffstat (limited to 'container-search/src/test/java')
-rw-r--r--container-search/src/test/java/com/yahoo/fs4/test/QueryTestCase.java1
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java2
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/fastsearch/FS4SearchInvokerTestCase.java7
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java5
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/InterleavedSearchInvokerTest.java18
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/MockInvoker.java3
-rw-r--r--container-search/src/test/java/com/yahoo/search/dispatch/rpc/RpcSearchInvokerTest.java5
-rw-r--r--container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java3
8 files changed, 19 insertions, 25 deletions
diff --git a/container-search/src/test/java/com/yahoo/fs4/test/QueryTestCase.java b/container-search/src/test/java/com/yahoo/fs4/test/QueryTestCase.java
index 911831e3a65..161ea4bdf64 100644
--- a/container-search/src/test/java/com/yahoo/fs4/test/QueryTestCase.java
+++ b/container-search/src/test/java/com/yahoo/fs4/test/QueryTestCase.java
@@ -310,5 +310,4 @@ public class QueryTestCase {
}
public static final byte ignored = -128;
-
}
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 1e19a1397e0..84f986d5371 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
@@ -201,7 +201,7 @@ public class ClusterSearcherTestCase {
}
@Override
- protected com.yahoo.search.Result doSearch2(Query query, QueryPacket queryPacket, Execution execution) {
+ protected com.yahoo.search.Result doSearch2(Query query, Execution execution) {
return null; // search() is overriden, this should never be called
}
diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/FS4SearchInvokerTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/FS4SearchInvokerTestCase.java
index 8fd3bc1f3eb..b9119528490 100644
--- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/FS4SearchInvokerTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/FS4SearchInvokerTestCase.java
@@ -3,7 +3,6 @@
package com.yahoo.prelude.fastsearch;
import com.yahoo.fs4.BasicPacket;
-import com.yahoo.fs4.QueryPacket;
import com.yahoo.fs4.mplex.FS4Channel;
import com.yahoo.fs4.mplex.InvalidChannelException;
import com.yahoo.search.Query;
@@ -31,10 +30,10 @@ public class FS4SearchInvokerTestCase {
var searcher = mockSearcher();
var cluster = new MockSearchCluster("?", 1, 1);
var fs4invoker = new FS4SearchInvoker(searcher, query, mockFailingChannel(), Optional.empty());
- var interleave = new InterleavedSearchInvoker(Collections.singleton(fs4invoker), searcher, cluster, null);
+ var interleave = new InterleavedSearchInvoker(Collections.singleton(fs4invoker), cluster, null);
long start = System.currentTimeMillis();
- interleave.search(query, QueryPacket.create(null, null), null);
+ interleave.search(query, null);
long elapsed = System.currentTimeMillis() - start;
assertThat("Connection error should fail fast", elapsed, Matchers.lessThan(500L));
@@ -43,7 +42,7 @@ public class FS4SearchInvokerTestCase {
private static VespaBackEndSearcher mockSearcher() {
return new VespaBackEndSearcher() {
@Override
- protected Result doSearch2(Query query, QueryPacket queryPacket, Execution execution) {
+ protected Result doSearch2(Query query, Execution execution) {
return null;
}
diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java
index ed0441d8450..cb43f2e17e3 100644
--- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java
@@ -3,7 +3,6 @@ package com.yahoo.prelude.fastsearch.test;
import com.google.common.util.concurrent.MoreExecutors;
import com.yahoo.component.chain.Chain;
-import com.yahoo.fs4.QueryPacket;
import com.yahoo.language.simple.SimpleLinguistics;
import com.yahoo.prelude.fastsearch.FastHit;
import com.yahoo.prelude.fastsearch.VespaBackEndSearcher;
@@ -32,7 +31,7 @@ public class PartialFillTestCase {
public static class FS4 extends VespaBackEndSearcher {
public List<Result> history = new ArrayList<>();
- protected Result doSearch2(Query query, QueryPacket queryPacket, Execution execution) {
+ protected Result doSearch2(Query query, Execution execution) {
return new Result(query);
}
protected void doPartialFill(Result result, String summaryClass) {
@@ -41,7 +40,7 @@ public class PartialFillTestCase {
}
public static class BadFS4 extends VespaBackEndSearcher {
- protected Result doSearch2(Query query, QueryPacket queryPacket, Execution execution) {
+ protected Result doSearch2(Query query, Execution execution) {
return new Result(query);
}
protected void doPartialFill(Result result, String summaryClass) {
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 f84f35020d2..8686ddf229b 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
@@ -49,7 +49,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(4900, 100, 1));
expectedEvents.add(new Event(4800, 100, 2));
- invoker.search(query, null, null);
+ invoker.search(query, null);
assertTrue("All test scenario events processed", expectedEvents.isEmpty());
}
@@ -63,7 +63,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(4700, 300, 1));
expectedEvents.add(null);
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
assertTrue("All test scenario events processed", expectedEvents.isEmpty());
assertNull("Result is not marked as an error", result.hits().getErrorHit());
@@ -82,7 +82,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(2400, 100, 2));
expectedEvents.add(new Event(0, 0, null));
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
assertTrue("All test scenario events processed", expectedEvents.isEmpty());
assertNull("Result is not marked as an error", result.hits().getErrorHit());
@@ -101,7 +101,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(new Event(null, 200, 1));
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
Coverage cov = result.getCoverage(true);
assertThat(cov.getDocs(), is(100000L));
@@ -122,7 +122,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(new Event(null, 200, 1));
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
Coverage cov = result.getCoverage(true);
assertThat(cov.getDocs(), is(23420L));
@@ -144,7 +144,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(new Event(null, 200, 1));
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
Coverage cov = result.getCoverage(true);
assertThat(cov.getDocs(), is(9900L));
@@ -166,7 +166,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 100, 0));
expectedEvents.add(null);
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
Coverage cov = result.getCoverage(true);
assertThat(cov.getDocs(), is(50155L));
@@ -191,7 +191,7 @@ public class InterleavedSearchInvokerTest {
expectedEvents.add(new Event(null, 1, 1));
expectedEvents.add(new Event(null, 100, 0));
- Result result = invoker.search(query, null, null);
+ Result result = invoker.search(query, null);
Coverage cov = result.getCoverage(true);
assertThat(cov.getDocs(), is(50155L));
@@ -209,7 +209,7 @@ public class InterleavedSearchInvokerTest {
invokers.add(new MockInvoker(i));
}
- return new InterleavedSearchInvoker(invokers, null, searchCluster, null) {
+ return new InterleavedSearchInvoker(invokers, searchCluster, null) {
@Override
protected long currentTime() {
return clock.millis();
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 00b1edec8b3..e347a884c17 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
@@ -1,7 +1,6 @@
// Copyright 2019 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.dispatch;
-import com.yahoo.fs4.QueryPacket;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.dispatch.searchcluster.Node;
@@ -25,7 +24,7 @@ class MockInvoker extends SearchInvoker {
}
@Override
- protected void sendSearchRequest(Query query, QueryPacket queryPacket) throws IOException {
+ protected void sendSearchRequest(Query query) throws IOException {
this.query = query;
}
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 b9d894f9eb5..64863b9a8a6 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,7 +5,6 @@ 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.fs4.QueryPacket;
import com.yahoo.prelude.fastsearch.FastHit;
import com.yahoo.prelude.fastsearch.VespaBackEndSearcher;
import com.yahoo.search.Query;
@@ -40,7 +39,7 @@ public class RpcSearchInvokerTest {
var invoker = new RpcSearchInvoker(mockSearcher(), new Node(7, "seven", 77, 1), mockPool);
Query q = new Query("search/?query=test&hits=10&offset=3");
- invoker.sendSearchRequest(q, null);
+ invoker.sendSearchRequest(q);
var bytes = mockPool.compressor().decompress(payloadHolder.get(), compressionTypeHolder.get(), lengthHolder.get());
var request = SearchProtocol.SearchRequest.newBuilder().mergeFrom(bytes).build();
@@ -78,7 +77,7 @@ public class RpcSearchInvokerTest {
private VespaBackEndSearcher mockSearcher() {
return new VespaBackEndSearcher() {
@Override
- protected Result doSearch2(Query query, QueryPacket queryPacket, Execution execution) {
+ protected Result doSearch2(Query query, Execution execution) {
fail("Unexpected call");
return null;
}
diff --git a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java
index f4be9bb543b..b656a509683 100644
--- a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsStreamingSearcherTestCase.java
@@ -136,9 +136,8 @@ public class VdsStreamingSearcherTestCase {
}
private static Result executeQuery(VdsStreamingSearcher searcher, Query query) {
- QueryPacket queryPacket = QueryPacket.create("container.0", query);
Execution execution = new Execution(new Execution.Context(null, null, null, null, null));
- return searcher.doSearch2(query, queryPacket, execution);
+ return searcher.doSearch2(query, execution);
}
private static Query[] generateTestQueries(String queryString) {