diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-03-11 15:51:38 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-03-11 15:51:38 +0100 |
commit | 354136dc94d1963384573d2f2728f1fb408f3d9a (patch) | |
tree | 407d5159ce0398464eb8b9302705fc84a7ed948a /container-search | |
parent | d51144a9aa9be319acb1a0b3677a403b8f5fc358 (diff) |
Rename FastBackend => Indexedbackend, and move some tests into the package they test.
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java | 20 | ||||
-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 |
5 files changed, 27 insertions, 50 deletions
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); - } - } |