summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2018-04-23 14:13:39 +0000
committerTor Egge <Tor.Egge@oath.com>2018-04-23 14:13:39 +0000
commitcb4cf3943a67e12b0e2fdc597efeb5998e46c573 (patch)
tree17ab68a3bd95ec434b80cf84cf066f15a3561b44 /searchcore
parent6aa64a88856f769332476f16610812c004478ff8 (diff)
Create read guard for target document meta store as part of creating
read guard for imported attribute vector.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp3
-rw-r--r--searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt1
-rw-r--r--searchcore/src/tests/proton/attribute/imported_attributes_context/imported_attributes_context_test.cpp3
3 files changed, 5 insertions, 2 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 0c38c645b07..9bf4d43fff7 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
@@ -16,6 +16,7 @@ LOG_SETUP("attribute_manager_test");
#include <vespa/searchcore/proton/attribute/sequential_attributes_initializer.h>
#include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h>
#include <vespa/searchcore/proton/common/hw_info.h>
+#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
#include <vespa/searchcore/proton/initializer/initializer_task.h>
#include <vespa/searchcore/proton/initializer/task_runner.h>
#include <vespa/searchcore/proton/server/executor_thread_service.h>
@@ -139,7 +140,7 @@ 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 targetDocumentMetaStore = std::shared_ptr<const search::IDocumentMetaStoreContext>();
+ auto targetDocumentMetaStore = std::make_shared<const DocumentMetaStoreContext>(std::make_shared<BucketDBOwner>());
auto importedAttr = ImportedAttributeVectorFactory::create(name, refAttr, documentMetaStore, targetAttr, targetDocumentMetaStore, false);
_repo->add(name, importedAttr);
}
diff --git a/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt b/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt
index 51365ee52f2..261242077b4 100644
--- a/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt
+++ b/searchcore/src/tests/proton/attribute/imported_attributes_context/CMakeLists.txt
@@ -4,5 +4,6 @@ vespa_add_executable(searchcore_imported_attributes_context_test_app TEST
imported_attributes_context_test.cpp
DEPENDS
searchcore_attribute
+ searchcore_documentmetastore
)
vespa_add_test(NAME searchcore_imported_attributes_context_test_app COMMAND searchcore_imported_attributes_context_test_app)
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 9f074b89235..2dc51d4577e 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
@@ -5,6 +5,7 @@ LOG_SETUP("imported_attributes_context_test");
#include <vespa/searchcore/proton/attribute/imported_attributes_context.h>
#include <vespa/searchcore/proton/attribute/imported_attributes_repo.h>
+#include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h>
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
@@ -79,7 +80,7 @@ struct Fixture {
createReferenceAttribute(name + "_ref"),
std::shared_ptr<search::IDocumentMetaStoreContext>(),
createTargetAttribute(name + "_target"),
- std::shared_ptr<const search::IDocumentMetaStoreContext>(),
+ std::make_shared<const DocumentMetaStoreContext>(std::make_shared<BucketDBOwner>()),
false);
repo.add(name, attr);
return *this;