aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2017-09-11 15:12:02 +0000
committerGeir Storli <geirst@oath.com>2017-09-11 15:12:02 +0000
commit67bf5f95c79f9452112931714fc1f273a19a5eb9 (patch)
tree4e54c19ab09085d9299a23a140b24da8f524cdb5 /searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
parentfcefafb47a56d9893834d27eb6de1759c8286193 (diff)
Keep a document meta store read guard together with bitvector posting list in search cache for imported attributes.
This is to ensure that no lids that are cached in the bitvector are re-used until the guard is released.
Diffstat (limited to 'searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
index 9efac9ce541..a085e21d6ae 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector.cpp
@@ -14,10 +14,12 @@ ImportedAttributeVector::ImportedAttributeVector(
vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
std::shared_ptr<AttributeVector> target_attribute,
+ std::shared_ptr<IDocumentMetaStoreContext> 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)),
_search_cache(use_search_cache ? std::make_shared<BitVectorSearchCache>() :
std::shared_ptr<BitVectorSearchCache>())
{
@@ -26,10 +28,12 @@ ImportedAttributeVector::ImportedAttributeVector(
ImportedAttributeVector::ImportedAttributeVector(vespalib::stringref name,
std::shared_ptr<ReferenceAttribute> reference_attribute,
std::shared_ptr<AttributeVector> target_attribute,
+ std::shared_ptr<IDocumentMetaStoreContext> 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)),
_search_cache(std::move(search_cache))
{
}
@@ -41,7 +45,7 @@ std::unique_ptr<ImportedAttributeVector>
ImportedAttributeVector::makeReadGuard(bool stableEnumGuard) const
{
return std::make_unique<ImportedAttributeVectorReadGuard>
- (getName(), getReferenceAttribute(), getTargetAttribute(), getSearchCache(), stableEnumGuard);
+ (getName(), getReferenceAttribute(), getTargetAttribute(), getDocumentMetaStore(), getSearchCache(), stableEnumGuard);
}
const vespalib::string& search::attribute::ImportedAttributeVector::getName() const {