summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/requestcontext.h18
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/search_session.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/persistenceengine/i_document_retriever.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/document_meta_store_read_guards.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/document_meta_store_context_observer.h2
-rw-r--r--searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h1
-rw-r--r--searchlib/src/tests/attribute/bitvector_search_cache/bitvector_search_cache_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/multi_value_read_view/multi_value_read_view_test.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_search_context.h2
-rw-r--r--searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h4
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.h2
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/irequestcontext.h4
-rw-r--r--searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h2
24 files changed, 50 insertions, 44 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.cpp
index ffb9acd5501..c8a5f925ed1 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.cpp
@@ -12,7 +12,7 @@ using vespalib::slime::Inserter;
namespace proton {
-DocumentMetaStoreExplorer::DocumentMetaStoreExplorer(IDocumentMetaStoreContext::IReadGuard::UP metaStore)
+DocumentMetaStoreExplorer::DocumentMetaStoreExplorer(IDocumentMetaStoreContext::IReadGuard::SP metaStore)
: _metaStore(std::move(metaStore))
{
}
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.h
index 978fd0b4a14..453c57ddcf1 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.h
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_explorer.h
@@ -13,10 +13,10 @@ namespace proton {
class DocumentMetaStoreExplorer : public vespalib::StateExplorer
{
private:
- IDocumentMetaStoreContext::IReadGuard::UP _metaStore;
+ IDocumentMetaStoreContext::IReadGuard::SP _metaStore;
public:
- DocumentMetaStoreExplorer(IDocumentMetaStoreContext::IReadGuard::UP metaStore);
+ DocumentMetaStoreExplorer(IDocumentMetaStoreContext::IReadGuard::SP metaStore);
void get_state(const vespalib::slime::Inserter &inserter, bool full) const override;
};
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h
index f85515922f9..81fecb75ea1 100644
--- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h
+++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h
@@ -46,8 +46,8 @@ public:
std::shared_ptr<proton::IDocumentMetaStore> getSP() const override { return _metaStore; }
proton::IDocumentMetaStore & get() override { return *_metaStore; }
- IReadGuard::UP getReadGuard() const override {
- return std::make_unique<ReadGuard>(_metaStoreAttr);
+ IReadGuard::SP getReadGuard() const override {
+ return std::make_shared<ReadGuard>(_metaStoreAttr);
}
void constructFreeList() override;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
index 0d5edf44d05..ddd8d83fd3b 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
@@ -27,7 +27,8 @@ RequestContext::RequestContext(const Doom & doom, IAttributeContext & attributeC
_attributeContext(attributeContext),
_query_env(query_env),
_shared_store(shared_store),
- _attribute_blueprint_params(attribute_blueprint_params)
+ _attribute_blueprint_params(attribute_blueprint_params),
+ _metaStoreReadGuard(nullptr)
{
}
@@ -63,10 +64,4 @@ RequestContext::get_query_tensor(const vespalib::string& tensor_name) const
}
}
-const search::attribute::AttributeBlueprintParams&
-RequestContext::get_attribute_blueprint_params() const
-{
- return _attribute_blueprint_params;
-}
-
}
diff --git a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.h b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.h
index 9ab9acc6d71..661e5fbd208 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.h
@@ -37,14 +37,20 @@ public:
const vespalib::eval::Value* get_query_tensor(const vespalib::string& tensor_name) const override;
- const search::attribute::AttributeBlueprintParams& get_attribute_blueprint_params() const override;
+ const search::attribute::AttributeBlueprintParams& get_attribute_blueprint_params() const override {
+ return _attribute_blueprint_params;
+ }
+ const MetaStoreReadGuardSP * getMetaStoreReadGuard() const override {
+ return _metaStoreReadGuard;
+ }
private:
- const Doom _doom;
- IAttributeContext & _attributeContext;
- const search::fef::IQueryEnvironment& _query_env;
- search::fef::IObjectStore& _shared_store;
- search::attribute::AttributeBlueprintParams _attribute_blueprint_params;
+ const Doom _doom;
+ IAttributeContext & _attributeContext;
+ const search::fef::IQueryEnvironment & _query_env;
+ search::fef::IObjectStore & _shared_store;
+ search::attribute::AttributeBlueprintParams _attribute_blueprint_params;
+ const MetaStoreReadGuardSP * _metaStoreReadGuard;
};
}
diff --git a/searchcore/src/vespa/searchcore/proton/matching/search_session.h b/searchcore/src/vespa/searchcore/proton/matching/search_session.h
index 4fc71b30f0a..2cc37a07564 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/search_session.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/search_session.h
@@ -29,7 +29,7 @@ public:
std::shared_ptr<const ISearchHandler> search_handler;
std::unique_ptr<search::fef::Properties> feature_overrides;
std::unique_ptr<MatchContext> context;
- IDocumentMetaStoreContext::IReadGuard::UP readGuard;
+ IDocumentMetaStoreContext::IReadGuard::SP readGuard;
};
private:
using SessionId = vespalib::string;
diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/i_document_retriever.h b/searchcore/src/vespa/searchcore/proton/persistenceengine/i_document_retriever.h
index 529b7759530..c2dba032ad1 100644
--- a/searchcore/src/vespa/searchcore/proton/persistenceengine/i_document_retriever.h
+++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/i_document_retriever.h
@@ -23,7 +23,7 @@ class IDocumentRetriever
{
public:
using ReadConsistency = storage::spi::ReadConsistency;
- using ReadGuard = IDocumentMetaStoreContext::IReadGuard::UP;
+ using ReadGuard = IDocumentMetaStoreContext::IReadGuard::SP;
using UP = std::unique_ptr<IDocumentRetriever>;
using SP = std::shared_ptr<IDocumentRetriever>;
diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h
index b0831bf2fcc..dd0e462aa49 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h
+++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_mapper.h
@@ -15,7 +15,7 @@ class DocumentMetaStore;
*/
class GidToLidMapper : public search::IGidToLidMapper
{
- search::IDocumentMetaStoreContext::IReadGuard::UP _guard;
+ search::IDocumentMetaStoreContext::IReadGuard::SP _guard;
public:
GidToLidMapper(const search::IDocumentMetaStoreContext &dmsContext);
virtual ~GidToLidMapper();
diff --git a/searchcore/src/vespa/searchcore/proton/server/document_meta_store_read_guards.h b/searchcore/src/vespa/searchcore/proton/server/document_meta_store_read_guards.h
index be22737a793..a0dac2b573c 100644
--- a/searchcore/src/vespa/searchcore/proton/server/document_meta_store_read_guards.h
+++ b/searchcore/src/vespa/searchcore/proton/server/document_meta_store_read_guards.h
@@ -14,9 +14,9 @@ class DocumentSubDBCollection;
*/
struct DocumentMetaStoreReadGuards
{
- IDocumentMetaStoreContext::IReadGuard::UP readydms;
- IDocumentMetaStoreContext::IReadGuard::UP notreadydms;
- IDocumentMetaStoreContext::IReadGuard::UP remdms;
+ IDocumentMetaStoreContext::IReadGuard::SP readydms;
+ IDocumentMetaStoreContext::IReadGuard::SP notreadydms;
+ IDocumentMetaStoreContext::IReadGuard::SP remdms;
DocumentMetaStoreReadGuards(const DocumentSubDBCollection &subDBs);
~DocumentMetaStoreReadGuards();
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp b/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp
index bb7d80c5ebc..8c6a3672829 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp
@@ -40,7 +40,7 @@ void
DocumentRetrieverBase::getBucketMetaData(
const storage::spi::Bucket &bucket,
search::DocumentMetaData::Vector &result) const {
- IDocumentMetaStoreContext::IReadGuard::UP readGuard = _meta_store.getReadGuard();
+ ReadGuard readGuard = _meta_store.getReadGuard();
const search::IDocumentMetaStore &meta_store = readGuard->get();
meta_store.getMetaData(bucket, result);
}
@@ -48,7 +48,7 @@ DocumentRetrieverBase::getBucketMetaData(
search::DocumentMetaData
DocumentRetrieverBase::getDocumentMetaData(const DocumentId &id) const {
const GlobalId &gid = id.getGlobalId();
- IDocumentMetaStoreContext::IReadGuard::UP readGuard = _meta_store.getReadGuard();
+ ReadGuard readGuard = _meta_store.getReadGuard();
const search::IDocumentMetaStore &meta_store = readGuard->get();
return meta_store.getMetaData(gid);
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
index 4683b27bae3..8fce39e5ede 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
@@ -160,7 +160,7 @@ bool
StoreOnlyDocSubDB::hasDocument(const document::DocumentId &id)
{
search::DocumentIdT lid;
- IDocumentMetaStoreContext::IReadGuard::UP guard = _metaStoreCtx->getReadGuard();
+ auto guard = _metaStoreCtx->getReadGuard();
return guard->get().getLid(id.getGlobalId(), lid);
}
diff --git a/searchcore/src/vespa/searchcore/proton/test/document_meta_store_context_observer.h b/searchcore/src/vespa/searchcore/proton/test/document_meta_store_context_observer.h
index b763942216d..8d8f1ee860a 100644
--- a/searchcore/src/vespa/searchcore/proton/test/document_meta_store_context_observer.h
+++ b/searchcore/src/vespa/searchcore/proton/test/document_meta_store_context_observer.h
@@ -26,7 +26,7 @@ struct DocumentMetaStoreContextObserver : public IDocumentMetaStoreContext
// Implements IDocumentMetaStoreContext
proton::IDocumentMetaStore::SP getSP() const override { return _observer; }
proton::IDocumentMetaStore & get() override { return *_observer; }
- IReadGuard::UP getReadGuard() const override { return _context.getReadGuard(); }
+ IReadGuard::SP getReadGuard() const override { return _context.getReadGuard(); }
void constructFreeList() override { return _context.constructFreeList(); }
};
diff --git a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
index 2bef9df4872..f46a1acd272 100644
--- a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
+++ b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
@@ -84,6 +84,7 @@ private:
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;
diff --git a/searchlib/src/tests/attribute/bitvector_search_cache/bitvector_search_cache_test.cpp b/searchlib/src/tests/attribute/bitvector_search_cache/bitvector_search_cache_test.cpp
index 655460496d3..273cbeba13a 100644
--- a/searchlib/src/tests/attribute/bitvector_search_cache/bitvector_search_cache_test.cpp
+++ b/searchlib/src/tests/attribute/bitvector_search_cache/bitvector_search_cache_test.cpp
@@ -14,7 +14,7 @@ using Entry = BitVectorSearchCache::Entry;
Entry::SP
makeEntry()
{
- return std::make_shared<Entry>(IDocumentMetaStoreContext::IReadGuard::UP(), BitVector::create(5), 10);
+ return std::make_shared<Entry>(IDocumentMetaStoreContext::IReadGuard::SP(), BitVector::create(5), 10);
}
struct Fixture {
diff --git a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
index 19327245083..311d3ef71e7 100644
--- a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
+++ b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
@@ -474,7 +474,7 @@ makeSearchCacheEntry(const std::vector<uint32_t> docIds, uint32_t docIdLimit)
for (uint32_t docId : docIds) {
bitVector->setBit(docId);
}
- return std::make_shared<BitVectorSearchCache::Entry>(IDocumentMetaStoreContext::IReadGuard::UP(), bitVector, docIdLimit);
+ return std::make_shared<BitVectorSearchCache::Entry>(IDocumentMetaStoreContext::IReadGuard::SP(), bitVector, docIdLimit);
}
TEST_F("Bit vector from search cache is used if found", SearchCacheFixture)
diff --git a/searchlib/src/tests/attribute/multi_value_read_view/multi_value_read_view_test.cpp b/searchlib/src/tests/attribute/multi_value_read_view/multi_value_read_view_test.cpp
index 651f4458008..b5798bfdcc8 100644
--- a/searchlib/src/tests/attribute/multi_value_read_view/multi_value_read_view_test.cpp
+++ b/searchlib/src/tests/attribute/multi_value_read_view/multi_value_read_view_test.cpp
@@ -53,13 +53,13 @@ struct MockReadGuard : public IDocumentMetaStoreContext::IReadGuard {
struct MockDocumentMetaStoreContext : public IDocumentMetaStoreContext
{
- std::unique_ptr<IReadGuard> getReadGuard() const override;
+ std::shared_ptr<IReadGuard> getReadGuard() const override;
};
-std::unique_ptr<IDocumentMetaStoreContext::IReadGuard>
+std::shared_ptr<IDocumentMetaStoreContext::IReadGuard>
MockDocumentMetaStoreContext::getReadGuard() const
{
- return std::make_unique<MockReadGuard>();
+ return std::make_shared<MockReadGuard>();
}
diff --git a/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h b/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h
index d200002bd32..ba1baa2037e 100644
--- a/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h
+++ b/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h
@@ -19,16 +19,16 @@ namespace search::attribute {
class BitVectorSearchCache {
public:
using BitVectorSP = std::shared_ptr<BitVector>;
- using ReadGuardUP = IDocumentMetaStoreContext::IReadGuard::UP;
+ using ReadGuardSP = IDocumentMetaStoreContext::IReadGuard::SP;
struct Entry {
using SP = std::shared_ptr<Entry>;
// We need to keep a document meta store read guard to ensure that no lids that are cached
// in the bit vector are re-used until the guard is released.
- ReadGuardUP dmsReadGuard;
+ ReadGuardSP dmsReadGuard;
BitVectorSP bitVector;
uint32_t docIdLimit;
- Entry(ReadGuardUP dmsReadGuard_, BitVectorSP bitVector_, uint32_t docIdLimit_) noexcept
+ Entry(ReadGuardSP dmsReadGuard_, BitVectorSP bitVector_, uint32_t docIdLimit_) noexcept
: dmsReadGuard(std::move(dmsReadGuard_)), bitVector(std::move(bitVector_)), docIdLimit(docIdLimit_) {}
};
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp
index 3d308b82b04..39a2a9f742c 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp
@@ -38,7 +38,7 @@ ImportedSearchContext::ImportedSearchContext(
_searchCacheLookup((_useSearchCache ? _imported_attribute.getSearchCache()->find(_queryTerm) :
std::shared_ptr<BitVectorSearchCache::Entry>())),
_dmsReadGuard((_useSearchCache && !_searchCacheLookup) ? imported_attribute.getDocumentMetaStore()->getReadGuard() :
- std::unique_ptr<IDocumentMetaStoreContext::IReadGuard>()),
+ std::shared_ptr<IDocumentMetaStoreContext::IReadGuard>()),
_reference_attribute(*_imported_attribute.getReferenceAttribute()),
_target_attribute(target_attribute),
_target_search_context(_target_attribute.createSearchContext(std::move(term), params)),
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.h b/searchlib/src/vespa/searchlib/attribute/imported_search_context.h
index d6b6d09e8fc..8ac874edaf2 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.h
+++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.h
@@ -34,7 +34,7 @@ class ImportedSearchContext : public ISearchContext {
vespalib::string _queryTerm;
bool _useSearchCache;
BitVectorSearchCache::Entry::SP _searchCacheLookup;
- IDocumentMetaStoreContext::IReadGuard::UP _dmsReadGuard;
+ IDocumentMetaStoreContext::IReadGuard::SP _dmsReadGuard;
const ReferenceAttribute& _reference_attribute;
const IAttributeVector &_target_attribute;
std::unique_ptr<ISearchContext> _target_search_context;
diff --git a/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h b/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h
index bb0583972d4..93492427372 100644
--- a/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h
+++ b/searchlib/src/vespa/searchlib/common/i_document_meta_store_context.h
@@ -19,7 +19,7 @@ struct IDocumentMetaStoreContext {
*/
struct IReadGuard {
- using UP = std::unique_ptr<IReadGuard>;
+ using SP = std::shared_ptr<IReadGuard>;
virtual ~IReadGuard() {}
@@ -35,7 +35,7 @@ struct IDocumentMetaStoreContext {
* Access to read interface.
* Should be used by all reader threads.
*/
- virtual IReadGuard::UP getReadGuard() const = 0;
+ virtual IReadGuard::SP getReadGuard() const = 0;
};
diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.h b/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.h
index 0b727dcea42..4e9f149ccee 100644
--- a/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.h
+++ b/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.h
@@ -47,7 +47,7 @@ public:
}
const search::attribute::AttributeBlueprintParams& get_attribute_blueprint_params() const override;
-
+ const MetaStoreReadGuardSP * getMetaStoreReadGuard() const override { return nullptr; }
private:
std::unique_ptr<vespalib::TestClock> _clock;
const vespalib::Doom _doom;
diff --git a/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h b/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h
index 52992a52103..09f1dc51f60 100644
--- a/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h
+++ b/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h
@@ -3,6 +3,7 @@
#pragma once
#include <vespa/vespalib/stllike/string.h>
+#include <vespa/searchlib/common/i_document_meta_store_context.h>
namespace search::attribute { struct AttributeBlueprintParams; }
namespace search::attribute { class IAttributeVector; }
@@ -17,6 +18,7 @@ namespace search::queryeval {
class IRequestContext
{
public:
+ using MetaStoreReadGuardSP = std::shared_ptr<IDocumentMetaStoreContext::IReadGuard>;
virtual ~IRequestContext() = default;
/**
@@ -39,6 +41,8 @@ public:
virtual const vespalib::eval::Value* get_query_tensor(const vespalib::string& tensor_name) const = 0;
virtual const search::attribute::AttributeBlueprintParams& get_attribute_blueprint_params() const = 0;
+
+ virtual const MetaStoreReadGuardSP * getMetaStoreReadGuard() const = 0;
};
}
diff --git a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp
index d1bb464fc37..3ccf2e9f752 100644
--- a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp
+++ b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp
@@ -14,10 +14,10 @@ namespace {
};
}
-IDocumentMetaStoreContext::IReadGuard::UP
+IDocumentMetaStoreContext::IReadGuard::SP
MockDocumentMetaStoreContext::getReadGuard() const {
++get_read_guard_cnt;
- return std::make_unique<MockReadGuard>();
+ return std::make_shared<MockReadGuard>();
}
}
diff --git a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
index 97fc49ce251..5117e2b2ef3 100644
--- a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
+++ b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
@@ -25,7 +25,7 @@ struct MockDocumentMetaStoreContext : public IDocumentMetaStoreContext {
mutable size_t get_read_guard_cnt;
MockDocumentMetaStoreContext() noexcept : get_read_guard_cnt(0) {}
- IReadGuard::UP getReadGuard() const override;
+ IReadGuard::SP getReadGuard() const override;
};
}