aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-05-12 15:08:29 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-05-12 16:12:02 +0000
commit96a665d19227e6937f6aed4c6d4c6ede20b91814 (patch)
tree82a84e9b70653128abc02f1a7fb1266248680b98
parent24630ef218beb0051f09a64d6d215de7918a676e (diff)
Reduce included code.
-rw-r--r--searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp1
-rw-r--r--searchcore/src/tests/proton/index/fusionrunner_test.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h16
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h5
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/querynodes.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h1
-rw-r--r--searchcore/src/vespa/searchcorespi/index/fakeindexsearchable.h12
-rw-r--r--searchcore/src/vespa/searchcorespi/index/indexcollection.h4
-rw-r--r--searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp3
-rw-r--r--searchcore/src/vespa/searchcorespi/index/indexsearchable.h2
-rw-r--r--searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp63
-rw-r--r--searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h52
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/field_index.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/i_field_index.h8
20 files changed, 98 insertions, 91 deletions
diff --git a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
index bb0eb89013c..6e9d4be97aa 100644
--- a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
@@ -19,6 +19,7 @@
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/query/query_term_simple.h>
#include <vespa/searchlib/queryeval/simpleresult.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/test/insertion_operators.h>
diff --git a/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp b/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp
index a45fb7591dc..8df61b0df09 100644
--- a/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp
@@ -4,6 +4,7 @@
#include <vespa/searchlib/fef/matchdata.h>
#include <vespa/searchlib/queryeval/searchiterator.h>
#include <vespa/searchlib/queryeval/simpleresult.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/vespalib/util/generationholder.h>
#include <vespa/vespalib/util/time.h>
#include <vespa/vespalib/gtest/gtest.h>
diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
index 7ee47a2ef91..c529c7b78c7 100644
--- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp
+++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
@@ -19,6 +19,7 @@
#include <vespa/searchlib/query/tree/simplequery.h>
#include <vespa/searchlib/test/index/mock_field_length_inspector.h>
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/vespalib/util/gate.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/testkit/testapp.h>
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp
index 27cffd67b86..daea227fe53 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp
@@ -13,6 +13,7 @@
#include <vespa/searchlib/attribute/readerbase.h>
#include <vespa/searchlib/common/i_gid_to_lid_mapper.h>
#include <vespa/searchlib/query/query_term_simple.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/util/bufferwriter.h>
#include <vespa/searchcommon/attribute/config.h>
#include <vespa/persistence/spi/bucket_limits.h>
@@ -784,7 +785,7 @@ DocumentMetaStore::getLidUsageStats() const
return {getCommittedDocIdLimit(), getNumUsedLids(), _lidAlloc.getLowestFreeLid(), _lidAlloc.getHighestUsedLid()};
}
-Blueprint::UP
+std::unique_ptr<Blueprint>
DocumentMetaStore::createWhiteListBlueprint() const
{
return _lidAlloc.createWhiteListBlueprint();
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h
index e6b87ffdfc7..f0d345b4b5a 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h
@@ -8,7 +8,6 @@
#include "lid_gid_key_comparator.h"
#include "raw_document_meta_data.h"
#include <vespa/searchcore/proton/common/subdbtype.h>
-#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/docstore/ibucketizer.h>
#include <vespa/searchcommon/common/growstrategy.h>
#include <vespa/vespalib/util/rcuvector.h>
@@ -202,7 +201,7 @@ public:
DocId getNumUsedLids() const override { return _lidAlloc.getNumUsedLids(); }
DocId getNumActiveLids() const override { return _lidAlloc.getNumActiveLids(); }
search::LidUsageStats getLidUsageStats() const override;
- search::queryeval::Blueprint::UP createWhiteListBlueprint() const override;
+ std::unique_ptr<search::queryeval::Blueprint> createWhiteListBlueprint() const override;
/**
* Implements search::AttributeVector
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp
index 162db5d8760..fcd98ca8601 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp
@@ -5,6 +5,7 @@
#include <vespa/searchlib/fef/termfieldmatchdataarray.h>
#include <vespa/searchlib/fef/matchdata.h>
#include <vespa/searchlib/queryeval/full_search.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <mutex>
#include <vespa/log/log.h>
@@ -12,7 +13,6 @@ LOG_SETUP(".proton.documentmetastore.lid_allocator");
using search::fef::TermFieldMatchDataArray;
using search::queryeval::Blueprint;
-using search::queryeval::FieldSpecBaseList;
using search::queryeval::FullSearch;
using search::queryeval::SearchIterator;
using search::queryeval::SimpleLeafBlueprint;
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h
index 2f38f47e4af..67f5f01ba60 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h
@@ -5,10 +5,12 @@
#include "lid_hold_list.h"
#include "lidstatevector.h"
#include <vespa/searchlib/attribute/attributeguard.h>
-#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/vespalib/util/memoryusage.h>
#include <atomic>
+namespace search::queryeval {
+ class Blueprint;
+}
namespace proton::documentmetastore {
/**
@@ -51,7 +53,7 @@ public:
generation_t currentGeneration);
bool holdLidOK(DocId lid, DocId lidLimit) const;
void constructFreeList(DocId lidLimit);
- search::queryeval::Blueprint::UP createWhiteListBlueprint() const;
+ std::unique_ptr<search::queryeval::Blueprint> createWhiteListBlueprint() const;
void updateActiveLids(DocId lid, bool active);
void clearDocs(DocId lidLow, DocId lidLimit);
void shrinkLidSpace(DocId committedDocIdLimit);
diff --git a/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h b/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h
index 0263dedfa08..2875ecf3a72 100644
--- a/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h
+++ b/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h
@@ -4,6 +4,7 @@
#include <vespa/searchcorespi/index/idiskindex.h>
#include <vespa/searchlib/common/tunefileinfo.h>
#include <vespa/searchlib/diskindex/diskindex.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
namespace proton {
@@ -21,14 +22,11 @@ public:
const search::TuneFileSearch &tuneFileSearch,
size_t cacheSize);
- /**
- * Implements searchcorespi::IndexSearchable
- */
- Blueprint::UP
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const IRequestContext & requestContext, const FieldSpec &field, const Node &term) override {
return _index.createBlueprint(requestContext, field, term);
}
- Blueprint::UP
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const IRequestContext & requestContext, const FieldSpecList &fields, const Node &term) override {
return _index.createBlueprint(requestContext, fields, term);
}
@@ -39,15 +37,7 @@ public:
search::SerialNum getSerialNum() const override;
void accept(searchcorespi::IndexSearchableVisitor &visitor) const override;
-
- /**
- * Implements IFieldLengthInspector
- */
search::index::FieldLengthInfo get_field_length_info(const vespalib::string& field_name) const override;
-
- /**
- * Implements proton::IDiskIndex
- */
const vespalib::string &getIndexDir() const override { return _index.getIndexDir(); }
const search::index::Schema &getSchema() const override { return _index.getSchema(); }
};
diff --git a/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h b/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h
index 432262a0322..3283bfb68eb 100644
--- a/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h
+++ b/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h
@@ -5,6 +5,7 @@
#include <vespa/searchlib/memoryindex/memory_index.h>
#include <vespa/searchcorespi/index/imemoryindex.h>
#include <vespa/searchcorespi/index/ithreadingservice.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/common/tunefileinfo.h>
#include <vespa/searchlib/common/fileheadercontext.h>
#include <atomic>
@@ -34,14 +35,14 @@ public:
/**
* Implements searchcorespi::IndexSearchable
*/
- search::queryeval::Blueprint::UP
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const search::queryeval::IRequestContext & requestContext,
const search::queryeval::FieldSpec &field,
const search::query::Node &term) override
{
return _index.createBlueprint(requestContext, field, term);
}
- search::queryeval::Blueprint::UP
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const search::queryeval::IRequestContext & requestContext,
const search::queryeval::FieldSpecList &fields,
const search::query::Node &term) override
diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h
index 4e9f03f2fac..03b274b7233 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h
@@ -2,7 +2,7 @@
#pragma once
-#include <vespa/searchlib/queryeval/blueprint.h>
+#include <vespa/searchlib/queryeval/field_spec.h>
#include <vespa/searchlib/fef/iindexenvironment.h>
#include <vespa/searchlib/fef/itermdata.h>
#include <vespa/searchlib/fef/simpletermdata.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
index ba508045be8..759170451b2 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
@@ -29,6 +29,9 @@
#include <mutex>
#include <condition_variable>
+namespace vespalib {
+ struct ThreadBundle;
+}
namespace search {
namespace attribute { class Interlock; }
namespace common { class FileHeaderContext; }
diff --git a/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h b/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h
index 4092f548016..b21cc809794 100644
--- a/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h
+++ b/searchcore/src/vespa/searchcore/proton/test/document_meta_store_observer.h
@@ -4,6 +4,7 @@
#include <vespa/searchcore/proton/documentmetastore/i_document_meta_store.h>
#include <vespa/searchcore/proton/documentmetastore/operation_listener.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
namespace proton::test {
diff --git a/searchcore/src/vespa/searchcorespi/index/fakeindexsearchable.h b/searchcore/src/vespa/searchcorespi/index/fakeindexsearchable.h
index 25a8b6847e9..b652388a560 100644
--- a/searchcore/src/vespa/searchcorespi/index/fakeindexsearchable.h
+++ b/searchcore/src/vespa/searchcorespi/index/fakeindexsearchable.h
@@ -4,6 +4,7 @@
#include "indexsearchable.h"
#include <vespa/searchlib/queryeval/fake_searchable.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
namespace searchcorespi {
@@ -18,11 +19,8 @@ public:
FakeIndexSearchable() : _fake() { }
search::queryeval::FakeSearchable &getFake() { return _fake; }
-
- /**
- * Implements IndexSearchable
- */
- Blueprint::UP
+
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const IRequestContext & requestContext,
const FieldSpec &field,
const Node &term) override
@@ -35,9 +33,7 @@ public:
}
search::SerialNum getSerialNum() const override { return 0; }
- void accept(IndexSearchableVisitor &visitor) const override {
- (void) visitor;
- }
+ void accept(IndexSearchableVisitor &) const override { }
search::index::FieldLengthInfo get_field_length_info(const vespalib::string& field_name) const override {
(void) field_name;
diff --git a/searchcore/src/vespa/searchcorespi/index/indexcollection.h b/searchcore/src/vespa/searchcorespi/index/indexcollection.h
index d9fb8e973e1..9d0949cb9de 100644
--- a/searchcore/src/vespa/searchcorespi/index/indexcollection.h
+++ b/searchcore/src/vespa/searchcorespi/index/indexcollection.h
@@ -46,9 +46,9 @@ public:
uint32_t getSourceId(uint32_t i) const override;
// Implements IndexSearchable
- Blueprint::UP
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const IRequestContext & requestContext, const FieldSpec &field, const Node &term) override;
- Blueprint::UP
+ std::unique_ptr<search::queryeval::Blueprint>
createBlueprint(const IRequestContext & requestContext, const FieldSpecList &fields, const Node &term) override;
search::SearchableStats getSearchableStats() const override;
search::SerialNum getSerialNum() const override;
diff --git a/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp
index 6712e5b7449..c814377af06 100644
--- a/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp
+++ b/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp
@@ -12,10 +12,10 @@
#include <vespa/document/fieldvalue/document.h>
#include <vespa/searchcorespi/flush/lambdaflushtask.h>
#include <vespa/searchlib/common/i_flush_token.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/index/schemautil.h>
#include <vespa/searchlib/util/filekit.h>
#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/vespalib/util/array.hpp>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/gate.h>
#include <vespa/vespalib/util/lambdatask.h>
@@ -36,6 +36,7 @@ using search::index::SchemaUtil;
using search::common::FileHeaderContext;
using search::queryeval::ISourceSelector;
using search::queryeval::Source;
+using search::queryeval::Blueprint;
using search::SerialNum;
using vespalib::makeLambdaTask;
using vespalib::makeSharedLambdaCallback;
diff --git a/searchcore/src/vespa/searchcorespi/index/indexsearchable.h b/searchcore/src/vespa/searchcorespi/index/indexsearchable.h
index 85e274fa0e0..84b982d5a09 100644
--- a/searchcore/src/vespa/searchcorespi/index/indexsearchable.h
+++ b/searchcore/src/vespa/searchcorespi/index/indexsearchable.h
@@ -6,7 +6,6 @@
#include <vespa/searchlib/common/serialnum.h>
#include <vespa/searchlib/index/i_field_length_inspector.h>
#include <vespa/searchlib/query/tree/node.h>
-#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/queryeval/field_spec.h>
#include <vespa/searchlib/queryeval/irequestcontext.h>
#include <vespa/searchlib/queryeval/searchable.h>
@@ -35,7 +34,6 @@ protected:
using FieldSpecList = search::queryeval::FieldSpecList;
using Node = search::query::Node;
using IAttributeContext = search::attribute::IAttributeContext;
- using Blueprint = search::queryeval::Blueprint;
public:
using SP = std::shared_ptr<IndexSearchable>;
diff --git a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp
index 8807def03d4..3403f43e150 100644
--- a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp
+++ b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp
@@ -4,6 +4,7 @@
#include "idiskindex.h"
#include <vespa/searchlib/fef/matchdatalayout.h>
#include <vespa/searchlib/query/tree/termnodes.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/vespalib/stllike/hash_set.h>
#include <vespa/vespalib/stllike/asciistream.h>
@@ -17,13 +18,57 @@ namespace searchcorespi {
using index::IDiskIndex;
using search::fef::MatchDataLayout;
+using search::fef::MatchData;
using search::index::FieldLengthInfo;
using search::query::StringBase;
+using search::query::Node;
using search::queryeval::Blueprint;
using search::queryeval::ISourceSelector;
using search::queryeval::SearchIterator;
+using search::queryeval::IRequestContext;
+using search::queryeval::FieldSpec;
+using search::queryeval::FieldSpecList;
using TermMap = vespalib::hash_set<vespalib::string>;
+namespace {
+class WarmupRequestContext : public IRequestContext {
+ using IAttributeVector = search::attribute::IAttributeVector;
+ using AttributeBlueprintParams = search::attribute::AttributeBlueprintParams;
+public:
+ WarmupRequestContext(const vespalib::Clock & clock);
+ ~WarmupRequestContext() override;
+ const vespalib::Doom & getDoom() const override { return _doom; }
+ const IAttributeVector *getAttribute(const vespalib::string &) const override { return nullptr; }
+ const IAttributeVector *getAttributeStableEnum(const vespalib::string &) const override { return nullptr; }
+ const vespalib::eval::Value* get_query_tensor(const vespalib::string&) const override;
+ const AttributeBlueprintParams& get_attribute_blueprint_params() const override { return _params; }
+ const MetaStoreReadGuardSP * getMetaStoreReadGuard() const override { return nullptr; }
+private:
+ const vespalib::Doom _doom;
+ const AttributeBlueprintParams _params;
+};
+class WarmupTask : public vespalib::Executor::Task {
+public:
+ WarmupTask(std::unique_ptr<MatchData> md, std::shared_ptr<WarmupIndexCollection> warmup);
+ ~WarmupTask() override;
+ WarmupTask &createBlueprint(const FieldSpec &field, const Node &term) {
+ _bluePrint = _warmup->createBlueprint(_requestContext, field, term);
+ return *this;
+ }
+ WarmupTask &createBlueprint(const FieldSpecList &fields, const Node &term) {
+ _bluePrint = _warmup->createBlueprint(_requestContext, fields, term);
+ return *this;
+ }
+private:
+ void run() override;
+ std::shared_ptr<WarmupIndexCollection> _warmup;
+ vespalib::RetainGuard _retainGuard;
+ std::unique_ptr<MatchData> _matchData;
+ std::unique_ptr<search::queryeval::Blueprint> _bluePrint;
+ WarmupRequestContext _requestContext;
+};
+}
+
class FieldTermMap : public vespalib::hash_map<uint32_t, TermMap>
{
@@ -228,30 +273,30 @@ WarmupIndexCollection::drainPending() {
_pendingTasks.waitForZeroRefCount();
}
-WarmupIndexCollection::WarmupRequestContext::WarmupRequestContext(const vespalib::Clock & clock)
+WarmupRequestContext::WarmupRequestContext(const vespalib::Clock & clock)
: _doom(clock, vespalib::steady_time::max(), vespalib::steady_time::max(), false)
{}
-WarmupIndexCollection::WarmupRequestContext::~WarmupRequestContext() = default;
+WarmupRequestContext::~WarmupRequestContext() = default;
const vespalib::eval::Value*
-WarmupIndexCollection::WarmupRequestContext::get_query_tensor(const vespalib::string&) const {
+WarmupRequestContext::get_query_tensor(const vespalib::string&) const {
return {};
}
-WarmupIndexCollection::WarmupTask::WarmupTask(std::unique_ptr<MatchData> md, std::shared_ptr<WarmupIndexCollection> warmup)
+WarmupTask::WarmupTask(std::unique_ptr<MatchData> md, std::shared_ptr<WarmupIndexCollection> warmup)
: _warmup(std::move(warmup)),
- _retainGuard(_warmup->_pendingTasks),
+ _retainGuard(_warmup->pendingTasks()),
_matchData(std::move(md)),
_bluePrint(),
- _requestContext(_warmup->_clock)
+ _requestContext(_warmup->clock())
{
}
-WarmupIndexCollection::WarmupTask::~WarmupTask() = default;
+WarmupTask::~WarmupTask() = default;
void
-WarmupIndexCollection::WarmupTask::run()
+WarmupTask::run()
{
- if (_warmup->_warmupEndTime != vespalib::steady_time()) {
+ if (_warmup->warmupEndTime() != vespalib::steady_time()) {
LOG(debug, "Warming up %s", _bluePrint->asString().c_str());
_bluePrint->fetchPostings(search::queryeval::ExecuteInfo::TRUE);
SearchIterator::UP it(_bluePrint->createSearch(*_matchData, true));
diff --git a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
index f46a1acd272..d02f5061c34 100644
--- a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
+++ b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
@@ -45,14 +45,10 @@ public:
uint32_t getSourceId(uint32_t i) const override;
// Implements IndexSearchable
- Blueprint::UP
- createBlueprint(const IRequestContext & requestContext,
- const FieldSpec &field,
- const Node &term) override;
- Blueprint::UP
- createBlueprint(const IRequestContext & requestContext,
- const FieldSpecList &fields,
- const Node &term) override;
+ std::unique_ptr<search::queryeval::Blueprint>
+ createBlueprint(const IRequestContext & requestContext, const FieldSpec &field, const Node &term) override;
+ std::unique_ptr<search::queryeval::Blueprint>
+ createBlueprint(const IRequestContext & requestContext, const FieldSpecList &fields, const Node &term) override;
search::SearchableStats getSearchableStats() const override;
search::SerialNum getSerialNum() const override;
void accept(IndexSearchableVisitor &visitor) const override;
@@ -70,45 +66,11 @@ public:
vespalib::string toString() const override;
bool doUnpack() const { return _warmupConfig.getUnpack(); }
void drainPending();
+ const vespalib::Clock & clock() const { return _clock; }
+ vespalib::steady_time warmupEndTime() const { return _warmupEndTime; }
+ vespalib::MonitoredRefCount & pendingTasks() { return _pendingTasks; }
private:
- using MatchData = search::fef::MatchData;
using Task = vespalib::Executor::Task;
- class WarmupRequestContext : public IRequestContext {
- using IAttributeVector = search::attribute::IAttributeVector;
- using AttributeBlueprintParams = search::attribute::AttributeBlueprintParams;
- public:
- WarmupRequestContext(const vespalib::Clock & clock);
- ~WarmupRequestContext() override;
- const vespalib::Doom & getDoom() const override { return _doom; }
- const IAttributeVector *getAttribute(const vespalib::string &) const override { return nullptr; }
- const IAttributeVector *getAttributeStableEnum(const vespalib::string &) const override { return nullptr; }
- const vespalib::eval::Value* get_query_tensor(const vespalib::string&) const override;
- const AttributeBlueprintParams& get_attribute_blueprint_params() const override { return _params; }
- const MetaStoreReadGuardSP * getMetaStoreReadGuard() const override { return nullptr; }
- private:
- const vespalib::Doom _doom;
- const AttributeBlueprintParams _params;
- };
- class WarmupTask : public Task {
- public:
- WarmupTask(std::unique_ptr<MatchData> md, std::shared_ptr<WarmupIndexCollection> warmup);
- ~WarmupTask() override;
- WarmupTask &createBlueprint(const FieldSpec &field, const Node &term) {
- _bluePrint = _warmup->createBlueprint(_requestContext, field, term);
- return *this;
- }
- WarmupTask &createBlueprint(const FieldSpecList &fields, const Node &term) {
- _bluePrint = _warmup->createBlueprint(_requestContext, fields, term);
- return *this;
- }
- private:
- void run() override;
- std::shared_ptr<WarmupIndexCollection> _warmup;
- vespalib::RetainGuard _retainGuard;
- std::unique_ptr<MatchData> _matchData;
- Blueprint::UP _bluePrint;
- WarmupRequestContext _requestContext;
- };
void fireWarmup(Task::UP task);
bool handledBefore(uint32_t fieldId, const Node &term);
diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp b/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp
index 8dd76a90b14..093052608c5 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp
@@ -5,6 +5,7 @@
#include "posting_iterator.h"
#include <vespa/searchlib/bitcompression/posocccompression.h>
#include <vespa/searchlib/queryeval/booleanmatchiteratorwrapper.h>
+#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/queryeval/filter_wrapper.h>
#include <vespa/searchlib/queryeval/searchiterator.h>
#include <vespa/vespalib/btree/btree.hpp>
diff --git a/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h b/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h
index b250c18625d..420037fa72b 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h
+++ b/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h
@@ -2,10 +2,14 @@
#pragma once
-#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/vespalib/util/generationhandler.h>
#include <vespa/vespalib/util/memoryusage.h>
+#include <memory>
+namespace search::queryeval {
+ struct SimpleLeafBlueprint;
+ class FieldSpec;
+}
namespace search::index {
class FieldLengthCalculator;
class IndexBuilder;
@@ -23,7 +27,7 @@ class WordStore;
*/
class IFieldIndex {
public:
- virtual ~IFieldIndex() {}
+ virtual ~IFieldIndex() = default;
virtual uint64_t getNumUniqueWords() const = 0;
virtual vespalib::MemoryUsage getMemoryUsage() const = 0;