summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-03-11 15:51:38 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2024-03-11 15:51:38 +0100
commit354136dc94d1963384573d2f2728f1fb408f3d9a (patch)
tree407d5159ce0398464eb8b9302705fc84a7ed948a
parentd51144a9aa9be319acb1a0b3677a403b8f5fc358 (diff)
Rename FastBackend => Indexedbackend, and move some tests into the package they test.
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java3
-rw-r--r--container-core/src/main/resources/configdefinitions/container.qr-searchers.def2
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java20
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/fastsearch/IndexedBackend.java (renamed from container-search/src/main/java/com/yahoo/prelude/fastsearch/FastBackend.java)14
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java (renamed from container-search/src/test/java/com/yahoo/prelude/fastsearch/test/DocsumDefinitionTestCase.java)10
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/fastsearch/IndexedBackendTestCase.java (renamed from container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java)21
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/fastsearch/PartialFillTestCase.java (renamed from container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java)12
7 files changed, 30 insertions, 52 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java b/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java
index f1c85699af5..5f363ff993f 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java
@@ -2,6 +2,7 @@
package com.yahoo.vespa.model.container;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
+import com.yahoo.prelude.fastsearch.IndexedBackend;
import com.yahoo.vespa.defaults.Defaults;
import java.nio.file.Path;
@@ -92,7 +93,7 @@ public class PlatformBundles {
com.yahoo.docproc.SimpleDocumentProcessor.class.getName(),
com.yahoo.language.simple.SimpleLinguistics.class.getName(),
com.yahoo.prelude.cluster.ClusterSearcher.class.getName(),
- com.yahoo.prelude.fastsearch.FastBackend.class.getName(),
+ IndexedBackend.class.getName(),
com.yahoo.prelude.fastsearch.VespaBackend.class.getName(),
com.yahoo.prelude.querytransform.CJKSearcher.class.getName(),
com.yahoo.prelude.querytransform.CollapsePhraseSearcher.class.getName(),
diff --git a/container-core/src/main/resources/configdefinitions/container.qr-searchers.def b/container-core/src/main/resources/configdefinitions/container.qr-searchers.def
index 2cd4af4fdf1..ac0c0dd6ada 100644
--- a/container-core/src/main/resources/configdefinitions/container.qr-searchers.def
+++ b/container-core/src/main/resources/configdefinitions/container.qr-searchers.def
@@ -25,7 +25,7 @@ com.yahoo.prelude.searcher.XMLStringSearcher.source string default=""
## Default docsum class the QR server should ask the backend to
## use for representing hints as default.
-com.yahoo.prelude.fastsearch.FastBackend.docsum.defaultclass string default=""
+com.yahoo.prelude.fastsearch.IndexedBackend.docsum.defaultclass string default=""
com.yahoo.prelude.querytransform.PhrasingSearcher.automatonfile string default=""
com.yahoo.prelude.querytransform.NonPhrasingSearcher.automatonfile string default=""
diff --git a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
index 28ba4fb09b2..a8605ab1597 100644
--- a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
+++ b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
@@ -11,7 +11,7 @@ import com.yahoo.container.core.documentapi.VespaDocumentAccess;
import com.yahoo.container.handler.VipStatus;
import com.yahoo.prelude.fastsearch.ClusterParams;
import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig;
-import com.yahoo.prelude.fastsearch.FastBackend;
+import com.yahoo.prelude.fastsearch.IndexedBackend;
import com.yahoo.prelude.fastsearch.SummaryParameters;
import com.yahoo.prelude.fastsearch.VespaBackend;
import com.yahoo.search.Query;
@@ -93,7 +93,7 @@ public class ClusterSearcher extends Searcher {
maxQueryCacheTimeout = ParameterParser.asMilliSeconds(clusterConfig.maxQueryCacheTimeout(), DEFAULT_MAX_QUERY_CACHE_TIMEOUT);
SummaryParameters docSumParams = new SummaryParameters(qrsConfig
- .com().yahoo().prelude().fastsearch().FastBackend().docsum()
+ .com().yahoo().prelude().fastsearch().IndexedBackend().docsum()
.defaultclass());
String uniqueServerId = UUID.randomUUID().toString();
@@ -130,20 +130,20 @@ public class ClusterSearcher extends Searcher {
return new ClusterParams("sc" + searchclusterIndex + ".num" + 0);
}
- private static FastBackend searchDispatch(int searchclusterIndex,
- String searchClusterName,
- String serverId,
- SummaryParameters docSumParams,
- DocumentdbInfoConfig documentdbInfoConfig,
- SchemaInfo schemaInfo,
- ComponentRegistry<Dispatcher> dispatchers) {
+ private static IndexedBackend searchDispatch(int searchclusterIndex,
+ String searchClusterName,
+ String serverId,
+ SummaryParameters docSumParams,
+ DocumentdbInfoConfig documentdbInfoConfig,
+ SchemaInfo schemaInfo,
+ ComponentRegistry<Dispatcher> dispatchers) {
ClusterParams clusterParams = makeClusterParams(searchclusterIndex);
ComponentId dispatcherComponentId = new ComponentId("dispatcher." + searchClusterName);
Dispatcher dispatcher = dispatchers.getComponent(dispatcherComponentId);
if (dispatcher == null)
throw new IllegalArgumentException("Configuration error: No dispatcher " + dispatcherComponentId +
" is configured");
- return new FastBackend(serverId, dispatcher, docSumParams, clusterParams, documentdbInfoConfig, schemaInfo);
+ return new IndexedBackend(serverId, dispatcher, docSumParams, clusterParams, documentdbInfoConfig, schemaInfo);
}
private static StreamingBackend streamingCluster(String serverId,
diff --git a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastBackend.java b/container-search/src/main/java/com/yahoo/prelude/fastsearch/IndexedBackend.java
index b1b3483af8c..294aff8d78b 100644
--- a/container-search/src/main/java/com/yahoo/prelude/fastsearch/FastBackend.java
+++ b/container-search/src/main/java/com/yahoo/prelude/fastsearch/IndexedBackend.java
@@ -30,7 +30,7 @@ import java.util.Optional;
// errors on results and returning them. It could be handy to create a QueryHandlingErrorException
// or similar which could wrap an error message, and then just always throw that and
// catch and unwrap into a results with an error in high level methods. -Jon
-public class FastBackend extends VespaBackend {
+public class IndexedBackend extends VespaBackend {
/** Used to dispatch directly to search nodes over RPC, replacing the old fnet communication path */
private final Dispatcher dispatcher;
@@ -48,12 +48,12 @@ public class FastBackend extends VespaBackend {
* @param clusterParams the cluster number, and other cluster backend parameters
* @param documentdbInfoConfig document database parameters
*/
- public FastBackend(String serverId,
- Dispatcher dispatcher,
- SummaryParameters docSumParams,
- ClusterParams clusterParams,
- DocumentdbInfoConfig documentdbInfoConfig,
- SchemaInfo schemaInfo) {
+ public IndexedBackend(String serverId,
+ Dispatcher dispatcher,
+ SummaryParameters docSumParams,
+ ClusterParams clusterParams,
+ DocumentdbInfoConfig documentdbInfoConfig,
+ SchemaInfo schemaInfo) {
init(serverId, docSumParams, clusterParams, documentdbInfoConfig, schemaInfo);
this.dispatcher = dispatcher;
}
diff --git a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/DocsumDefinitionTestCase.java b/container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java
index ade094115fe..ba9988b865c 100644
--- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/DocsumDefinitionTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/DocsumDefinitionTestCase.java
@@ -1,14 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.prelude.fastsearch.test;
+package com.yahoo.prelude.fastsearch;
-import com.yahoo.prelude.fastsearch.ByteField;
-import com.yahoo.prelude.fastsearch.DataField;
-import com.yahoo.prelude.fastsearch.DocsumDefinition;
-import com.yahoo.prelude.fastsearch.DocsumDefinitionSet;
-import com.yahoo.prelude.fastsearch.FastHit;
-import com.yahoo.prelude.fastsearch.IntegerField;
-import com.yahoo.prelude.fastsearch.StringField;
-import com.yahoo.document.DocumentId;
import com.yahoo.document.GlobalId;
import com.yahoo.search.schema.DocumentSummary;
import com.yahoo.search.schema.Schema;
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/IndexedBackendTestCase.java
index 3928743c954..917206bf00c 100644
--- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/FastSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/IndexedBackendTestCase.java
@@ -1,14 +1,9 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.prelude.fastsearch.test;
+package com.yahoo.prelude.fastsearch;
import com.yahoo.container.QrSearchersConfig;
import com.yahoo.container.handler.VipStatus;
import com.yahoo.container.protect.Error;
-import com.yahoo.prelude.fastsearch.ClusterParams;
-import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig;
-import com.yahoo.prelude.fastsearch.FastBackend;
-import com.yahoo.prelude.fastsearch.SummaryParameters;
-import com.yahoo.prelude.fastsearch.VespaBackend;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.dispatch.MockDispatcher;
@@ -38,14 +33,14 @@ import static org.junit.jupiter.api.Assertions.*;
*
* @author bratseth
*/
-public class FastSearcherTestCase {
+public class IndexedBackendTestCase {
private static final String SCHEMA = "test";
private static final String CLUSTER = "test";
@Test
void testNullQuery() {
- Logger.getLogger(FastBackend.class.getName()).setLevel(Level.ALL);
- FastBackend fastSearcher = new FastBackend("container.0",
+ Logger.getLogger(IndexedBackend.class.getName()).setLevel(Level.ALL);
+ IndexedBackend fastSearcher = new IndexedBackend("container.0",
MockDispatcher.create(List.of()),
new SummaryParameters(null),
new ClusterParams("testhittype"),
@@ -70,7 +65,7 @@ public class FastSearcherTestCase {
@Test
void testSinglePassGroupingIsForcedWithSingleNodeGroups() {
- FastBackend fastSearcher = new FastBackend("container.0",
+ IndexedBackend fastSearcher = new IndexedBackend("container.0",
MockDispatcher.create(List.of(new Node(CLUSTER, 0, "host0", 0))),
new SummaryParameters(null),
new ClusterParams("testhittype"),
@@ -93,7 +88,7 @@ public class FastSearcherTestCase {
@Test
void testRankProfileValidation() {
- FastBackend fastSearcher = new FastBackend("container.0",
+ IndexedBackend fastSearcher = new IndexedBackend("container.0",
MockDispatcher.create(List.of(new Node(CLUSTER, 0, "host0", 0))),
new SummaryParameters(null),
new ClusterParams("testhittype"),
@@ -112,7 +107,7 @@ public class FastSearcherTestCase {
.add(new RankProfile.Builder("default").setHasRankFeatures(false)
.setHasSummaryFeatures(false)
.build());
- FastBackend backend = new FastBackend("container.0",
+ IndexedBackend backend = new IndexedBackend("container.0",
MockDispatcher.create(Collections.singletonList(new Node(CLUSTER, 0, "host0", 0))),
new SummaryParameters(null),
new ClusterParams("testhittype"),
@@ -132,7 +127,7 @@ public class FastSearcherTestCase {
void testSinglePassGroupingIsNotForcedWithSingleNodeGroups() {
MockDispatcher dispatcher = MockDispatcher.create(List.of(new Node(CLUSTER, 0, "host0", 0), new Node(CLUSTER, 2, "host1", 0)));
- FastBackend fastSearcher = new FastBackend("container.0",
+ IndexedBackend fastSearcher = new IndexedBackend("container.0",
dispatcher,
new SummaryParameters(null),
new ClusterParams("testhittype"),
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/PartialFillTestCase.java
index cf5a0ca7bd9..7760e204d4b 100644
--- a/container-search/src/test/java/com/yahoo/prelude/fastsearch/test/PartialFillTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/fastsearch/PartialFillTestCase.java
@@ -1,12 +1,8 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.prelude.fastsearch.test;
+package com.yahoo.prelude.fastsearch;
-import com.yahoo.component.chain.Chain;
-import com.yahoo.prelude.fastsearch.FastHit;
-import com.yahoo.prelude.fastsearch.VespaBackend;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
-import com.yahoo.search.Searcher;
import com.yahoo.search.result.ErrorHit;
import com.yahoo.search.result.ErrorMessage;
import org.junit.jupiter.api.Test;
@@ -141,10 +137,4 @@ public class PartialFillTestCase {
searcher.fill(result, summaryClass);
}
- private Chain<Searcher> chainedAsSearchChain(Searcher topOfChain) {
- List<Searcher> searchers = new ArrayList<>();
- searchers.add(topOfChain);
- return new Chain<>(searchers);
- }
-
}