diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-09-11 13:00:32 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-09-11 13:00:32 +0000 |
commit | 5d131e88460f33a8bd16f39d5d57c1c690fd79f2 (patch) | |
tree | 44415dbc076bb8736ba7d56ee18d653f7b19213a /searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp | |
parent | 608a89f6e3d0d6832f9854b2fc0d692fee4857f8 (diff) |
Keep a gid to lid mapper live during the lifetime of an imported attribute
read guard, to avoid premature reuse of referenced lid.
Diffstat (limited to 'searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp')
-rw-r--r-- | searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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 d95d79fbd11..afbaabd9fc3 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 @@ -8,6 +8,7 @@ LOG_SETUP("imported_attributes_context_test"); #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/imported_attribute_vector.h> +#include <vespa/searchlib/test/mock_gid_to_lid_mapping.h> #include <future> using namespace proton; @@ -17,12 +18,15 @@ using search::attribute::Config; using search::attribute::IAttributeVector; using search::attribute::ImportedAttributeVector; using search::attribute::ReferenceAttribute; +using search::attribute::test::MockGidToLidMapperFactory; using generation_t = AttributeVector::generation_t; ReferenceAttribute::SP createReferenceAttribute(const vespalib::string &name) { - return std::make_shared<ReferenceAttribute>(name, Config(BasicType::REFERENCE)); + auto refAttr = std::make_shared<ReferenceAttribute>(name, Config(BasicType::REFERENCE)); + refAttr->setGidToLidMapperFactory(std::make_shared<MockGidToLidMapperFactory>()); + return refAttr; } AttributeVector::SP |