aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2018-04-23 13:38:48 +0000
committerTor Egge <Tor.Egge@oath.com>2018-04-23 13:53:39 +0000
commit6aa64a88856f769332476f16610812c004478ff8 (patch)
tree7db48103c3719f2e69cdc7b03ee202b4715b89c7
parenta4417a32a4e048bbdb2e347307f93de5bca865e1 (diff)
Add shared pointer to document meta store context for referenced
document type to imported attribute vector.
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp3
-rw-r--r--searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h3
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.h16
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.cpp14
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.h6
-rw-r--r--searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.h6
-rw-r--r--searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h8
17 files changed, 76 insertions, 31 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
index 59393ac0a26..0c38c645b07 100644
--- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
@@ -139,7 +139,8 @@ struct ImportedAttributesRepoBuilder {
refAttr->setGidToLidMapperFactory(std::make_shared<MockGidToLidMapperFactory>());
auto targetAttr = search::AttributeFactory::createAttribute(name + "_target", INT32_SINGLE);
auto documentMetaStore = std::shared_ptr<search::IDocumentMetaStoreContext>();
- auto importedAttr = ImportedAttributeVectorFactory::create(name, refAttr, targetAttr, documentMetaStore, false);
+ auto targetDocumentMetaStore = std::shared_ptr<const search::IDocumentMetaStoreContext>();
+ auto importedAttr = ImportedAttributeVectorFactory::create(name, refAttr, documentMetaStore, targetAttr, targetDocumentMetaStore, false);
_repo->add(name, importedAttr);
}
ImportedAttributesRepo::UP build() {
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index 4a9d1b31c8e..ee5f29255fb 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -748,8 +748,9 @@ createImportedAttribute(const vespalib::string &name)
{
auto result = ImportedAttributeVectorFactory::create(name,
std::shared_ptr<ReferenceAttribute>(),
- AttributeVector::SP(),
std::shared_ptr<search::IDocumentMetaStoreContext>(),
+ AttributeVector::SP(),
+ std::shared_ptr<const search::IDocumentMetaStoreContext>(),
true);
result->getSearchCache()->insert("foo", BitVectorSearchCache::Entry::SP());
return result;
diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp
index 998537b2745..9f074b89235 100644
--- a/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp
+++ b/searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp
@@ -77,8 +77,9 @@ struct Fixture {
Fixture &addAttribute(const vespalib::string &name) {
auto attr = ImportedAttributeVectorFactory::create(name,
createReferenceAttribute(name + "_ref"),
- createTargetAttribute(name + "_target"),
std::shared_ptr<search::IDocumentMetaStoreContext>(),
+ createTargetAttribute(name + "_target"),
+ std::shared_ptr<const search::IDocumentMetaStoreContext>(),
false);
repo.add(name, attr);
return *this;
diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp b/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp
index ddabed210d8..d92392ec8df 100644
--- a/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp
+++ b/searchcore/src/tests/proton/attribute/imported_attributes_repo/imported_attributes_repo_test.cpp
@@ -23,8 +23,9 @@ createAttr(const vespalib::string &name)
{
return ImportedAttributeVectorFactory::create(name,
ReferenceAttribute::SP(),
- AttributeVector::SP(),
std::shared_ptr<search::IDocumentMetaStoreContext>(),
+ AttributeVector::SP(),
+ std::shared_ptr<const search::IDocumentMetaStoreContext>(),
false);
}
diff --git a/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp b/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp
index b600d6842bd..fc9d2d770cd 100644
--- a/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp
+++ b/searchcore/src/tests/proton/reference/document_db_reference/document_db_reference_test.cpp
@@ -26,8 +26,9 @@ makeImportedAttributesRepo()
ImportedAttributesRepo::UP result = std::make_unique<ImportedAttributesRepo>();
ImportedAttributeVector::SP attr = std::make_shared<ImportedAttributeVector>("imported",
std::shared_ptr<ReferenceAttribute>(),
+ std::shared_ptr<IDocumentMetaStoreContext>(),
std::shared_ptr<ReadableAttributeVector>(),
- std::shared_ptr<IDocumentMetaStoreContext>(), false);
+ std::shared_ptr<const IDocumentMetaStoreContext>(), false);
result->add("imported", std::move(attr));
return result;
}
diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp
index cf8943595d2..61f534fe006 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp
+++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.cpp
@@ -39,6 +39,12 @@ DocumentDBReference::getAttribute(vespalib::stringref name)
}
}
+std::shared_ptr<const search::IDocumentMetaStoreContext>
+DocumentDBReference::getDocumentMetaStoreContext() const
+{
+ return _dmsContext;
+}
+
std::shared_ptr<search::IGidToLidMapperFactory>
DocumentDBReference::getGidToLidMapperFactory()
{
diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h
index 1d55342dbdc..52a06e52f1a 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h
+++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference.h
@@ -26,6 +26,7 @@ public:
std::shared_ptr<IGidToLidChangeHandler> gidToLidChangeHandler);
virtual ~DocumentDBReference();
virtual std::shared_ptr<search::attribute::ReadableAttributeVector> getAttribute(vespalib::stringref name) override;
+ virtual std::shared_ptr<const search::IDocumentMetaStoreContext> getDocumentMetaStoreContext() const override;
virtual std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() override;
virtual std::unique_ptr<GidToLidChangeRegistrator> makeGidToLidChangeRegistrator(const vespalib::string &docTypeName) override;
};
diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp
index 99b7eb300bf..cf6f0b99176 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp
+++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp
@@ -143,8 +143,10 @@ DocumentDBReferenceResolver::createImportedAttributesRepo(const IAttributeManage
if (_useReferences) {
for (const auto &attr : _importedFieldsCfg.attribute) {
ReferenceAttribute::SP refAttr = getReferenceAttribute(attr.referencefield, attrMgr);
- auto targetAttr = getTargetDocumentDB(refAttr->getName())->getAttribute(attr.targetfield);
- auto importedAttr = ImportedAttributeVectorFactory::create(attr.name, refAttr, targetAttr, documentMetaStore, useSearchCache);
+ auto targetDocumentDB = getTargetDocumentDB(refAttr->getName());
+ auto targetAttr = targetDocumentDB->getAttribute(attr.targetfield);
+ auto targetDocumentMetaStore = targetDocumentDB->getDocumentMetaStoreContext();
+ auto importedAttr = ImportedAttributeVectorFactory::create(attr.name, refAttr, documentMetaStore, targetAttr, targetDocumentMetaStore, useSearchCache);
result->add(importedAttr->getName(), importedAttr);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h b/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h
index a37a553ed40..54f8009d1b8 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h
+++ b/searchcore/src/vespa/searchcore/proton/reference/i_document_db_reference.h
@@ -8,6 +8,7 @@ namespace search::attribute { class ReadableAttributeVector; }
namespace search {
class IGidToLidMapperFactory;
+class IDocumentMetaStoreContext;
}
@@ -26,6 +27,7 @@ public:
using SP = std::shared_ptr<IDocumentDBReference>;
virtual ~IDocumentDBReference() { }
virtual std::shared_ptr<search::attribute::ReadableAttributeVector> getAttribute(vespalib::stringref name) = 0;
+ virtual std::shared_ptr<const search::IDocumentMetaStoreContext> getDocumentMetaStoreContext() const = 0;
virtual std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() = 0;
virtual std::unique_ptr<GidToLidChangeRegistrator> makeGidToLidChangeRegistrator(const vespalib::string &docTypeName) = 0;
};
diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h b/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h
index defe78c0e75..cc91779faef 100644
--- a/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h
+++ b/searchcore/src/vespa/searchcore/proton/test/mock_document_db_reference.h
@@ -18,6 +18,9 @@ struct MockDocumentDBReference : public IDocumentDBReference {
virtual std::shared_ptr<search::attribute::ReadableAttributeVector> getAttribute(vespalib::stringref) override {
return std::shared_ptr<search::attribute::ReadableAttributeVector>();
}
+ virtual std::shared_ptr<const search::IDocumentMetaStoreContext> getDocumentMetaStoreContext() const override {
+ return std::shared_ptr<const search::IDocumentMetaStoreContext>();
+ }
virtual std::shared_ptr<search::IGidToLidMapperFactory> getGidToLidMapperFactory() override {
return std::shared_ptr<search::IGidToLidMapperFactory>();
}
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
index 37969bc1eed..0ba4bc814d5 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
@@ -10,13 +10,15 @@ namespace search::attribute {
ImportedAttributeVector::ImportedAttributeVector(
vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
bool use_search_cache)
: _name(name),
_reference_attribute(std::move(reference_attribute)),
- _target_attribute(std::move(target_attribute)),
_document_meta_store(std::move(document_meta_store)),
+ _target_attribute(std::move(target_attribute)),
+ _target_document_meta_store(std::move(target_document_meta_store)),
_search_cache(use_search_cache ? std::make_shared<BitVectorSearchCache>() :
std::shared_ptr<BitVectorSearchCache>())
{
@@ -24,13 +26,15 @@ ImportedAttributeVector::ImportedAttributeVector(
ImportedAttributeVector::ImportedAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
std::shared_ptr<BitVectorSearchCache> search_cache)
: _name(name),
_reference_attribute(std::move(reference_attribute)),
- _target_attribute(std::move(target_attribute)),
_document_meta_store(std::move(document_meta_store)),
+ _target_attribute(std::move(target_attribute)),
+ _target_document_meta_store(std::move(target_document_meta_store)),
_search_cache(std::move(search_cache))
{
}
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.h b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.h
index 6ad69fa88eb..95fa65e98eb 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.h
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.h
@@ -31,24 +31,29 @@ public:
using SP = std::shared_ptr<ImportedAttributeVector>;
ImportedAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
bool use_search_cache);
ImportedAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
std::shared_ptr<BitVectorSearchCache> search_cache);
virtual ~ImportedAttributeVector();
const std::shared_ptr<ReferenceAttribute>& getReferenceAttribute() const noexcept {
return _reference_attribute;
}
+ const std::shared_ptr<IDocumentMetaStoreContext> &getDocumentMetaStore() const {
+ return _document_meta_store;
+ }
const std::shared_ptr<ReadableAttributeVector>& getTargetAttribute() const noexcept {
return _target_attribute;
}
- const std::shared_ptr<IDocumentMetaStoreContext> &getDocumentMetaStore() const {
- return _document_meta_store;
+ const std::shared_ptr<const IDocumentMetaStoreContext> &getTargetDocumentMetaStore() const {
+ return _target_document_meta_store;
}
const std::shared_ptr<BitVectorSearchCache> &getSearchCache() const {
return _search_cache;
@@ -63,8 +68,9 @@ public:
protected:
vespalib::string _name;
std::shared_ptr<ReferenceAttribute> _reference_attribute;
- std::shared_ptr<ReadableAttributeVector> _target_attribute;
std::shared_ptr<IDocumentMetaStoreContext> _document_meta_store;
+ std::shared_ptr<ReadableAttributeVector> _target_attribute;
+ std::shared_ptr<const IDocumentMetaStoreContext> _target_document_meta_store;
std::shared_ptr<BitVectorSearchCache> _search_cache;
};
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.cpp b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.cpp
index ae0fdcf1b83..5847b8953a4 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.cpp
@@ -27,15 +27,16 @@ BasicType::Type getBasicType(const std::shared_ptr<attribute::ReadableAttributeV
std::shared_ptr<ImportedAttributeVector>
ImportedAttributeVectorFactory::create(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
bool use_search_cache)
{
switch (getBasicType(target_attribute)) {
case BasicType::Type::TENSOR:
- return std::make_shared<ImportedTensorAttributeVector>(name, std::move(reference_attribute), std::move(target_attribute), std::move(document_meta_store), use_search_cache);
+ return std::make_shared<ImportedTensorAttributeVector>(name, std::move(reference_attribute), std::move(document_meta_store), std::move(target_attribute), std::move(target_document_meta_store), use_search_cache);
default:
- return std::make_shared<ImportedAttributeVector>(name, std::move(reference_attribute), std::move(target_attribute), std::move(document_meta_store), use_search_cache);
+ return std::make_shared<ImportedAttributeVector>(name, std::move(reference_attribute), std::move(document_meta_store), std::move(target_attribute), std::move(target_document_meta_store), use_search_cache);
}
}
@@ -43,15 +44,16 @@ ImportedAttributeVectorFactory::create(vespalib::stringref name,
std::shared_ptr<ImportedAttributeVector>
ImportedAttributeVectorFactory::create(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
std::shared_ptr<BitVectorSearchCache> search_cache)
{
switch (getBasicType(target_attribute)) {
case BasicType::Type::TENSOR:
- return std::make_shared<ImportedTensorAttributeVector>(name, std::move(reference_attribute), std::move(target_attribute), std::move(document_meta_store), std::move(search_cache));
+ return std::make_shared<ImportedTensorAttributeVector>(name, std::move(reference_attribute), std::move(document_meta_store), std::move(target_attribute), std::move(target_document_meta_store), std::move(search_cache));
default:
- return std::make_shared<ImportedAttributeVector>(name, std::move(reference_attribute), std::move(target_attribute), std::move(document_meta_store), std::move(search_cache));
+ return std::make_shared<ImportedAttributeVector>(name, std::move(reference_attribute), std::move(document_meta_store), std::move(target_attribute), std::move(target_document_meta_store), std::move(search_cache));
}
}
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.h b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.h
index 9c3b5a8bb47..c8836c0be1f 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.h
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_factory.h
@@ -25,15 +25,17 @@ public:
static std::shared_ptr<ImportedAttributeVector>
create(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
bool use_search_cache);
static std::shared_ptr<ImportedAttributeVector>
create(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
std::shared_ptr<BitVectorSearchCache> search_cache);
};
diff --git a/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.cpp b/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.cpp
index 6b3f4adb6e4..0b13c999984 100644
--- a/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.cpp
@@ -10,24 +10,28 @@ using vespalib::tensor::Tensor;
ImportedTensorAttributeVector::ImportedTensorAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
bool use_search_cache)
: ImportedAttributeVector(name, std::move(reference_attribute),
- std::move(target_attribute),
std::move(document_meta_store),
+ std::move(target_attribute),
+ std::move(target_document_meta_store),
use_search_cache)
{
}
ImportedTensorAttributeVector::ImportedTensorAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
std::shared_ptr<BitVectorSearchCache> search_cache)
: ImportedAttributeVector(name, std::move(reference_attribute),
- std::move(target_attribute),
std::move(document_meta_store),
+ std::move(target_attribute),
+ std::move(target_document_meta_store),
std::move(search_cache))
{
}
diff --git a/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.h b/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.h
index c7ccd9ec599..5d5d363d193 100644
--- a/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.h
+++ b/searchlib/src/vespa/searchlib/tensor/imported_tensor_attribute_vector.h
@@ -19,13 +19,15 @@ class ImportedTensorAttributeVector : public attribute::ImportedAttributeVector
public:
ImportedTensorAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
bool use_search_cache);
ImportedTensorAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
- std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
std::shared_ptr<IDocumentMetaStoreContext> document_meta_store,
+ std::shared_ptr<attribute::ReadableAttributeVector> target_attribute,
+ std::shared_ptr<const IDocumentMetaStoreContext> target_document_meta_store,
std::shared_ptr<BitVectorSearchCache> search_cache);
~ImportedTensorAttributeVector();
diff --git a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
index 3eb20e1b646..1c4813a5c45 100644
--- a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
+++ b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
@@ -64,6 +64,10 @@ std::shared_ptr<ReferenceAttribute> create_reference_attribute(vespalib::stringr
return std::make_shared<ReferenceAttribute>(name, Config(BasicType::REFERENCE));
}
+MockDocumentMetaStoreContext::SP create_target_document_meta_store() {
+ return std::make_shared<MockDocumentMetaStoreContext>();
+}
+
MockDocumentMetaStoreContext::SP create_document_meta_store() {
return std::make_shared<MockDocumentMetaStoreContext>();
}
@@ -149,6 +153,7 @@ struct ReadGuardWrapper {
struct ImportedAttributeFixture {
bool use_search_cache;
std::shared_ptr<AttributeVector> target_attr;
+ MockDocumentMetaStoreContext::SP target_document_meta_store;
std::shared_ptr<ReferenceAttribute> reference_attr;
MockDocumentMetaStoreContext::SP document_meta_store;
std::shared_ptr<ImportedAttributeVector> imported_attr;
@@ -180,7 +185,7 @@ struct ImportedAttributeFixture {
std::shared_ptr<ImportedAttributeVector>
create_attribute_vector_from_members(vespalib::stringref name = default_imported_attr_name()) {
- return ImportedAttributeVectorFactory::create(name, reference_attr, target_attr, document_meta_store, use_search_cache);
+ return ImportedAttributeVectorFactory::create(name, reference_attr, document_meta_store, target_attr, target_document_meta_store, use_search_cache);
}
template<typename AttrVecType>
@@ -283,6 +288,7 @@ struct ImportedAttributeFixture {
ImportedAttributeFixture::ImportedAttributeFixture(bool use_search_cache_)
: use_search_cache(use_search_cache_),
target_attr(create_single_attribute<IntegerAttribute>(BasicType::INT32)),
+ target_document_meta_store(create_target_document_meta_store()),
reference_attr(create_reference_attribute()),
document_meta_store(create_document_meta_store()),
imported_attr(create_attribute_vector_from_members()),