summaryrefslogtreecommitdiffstats
path: root/searchcore/src
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-02-02 14:48:20 +0100
committerTor Egge <Tor.Egge@online.no>2023-02-02 14:48:20 +0100
commit0d5d8e73867e44e84e97e8f5b70069e613f5643a (patch)
tree1c2b5b52c643620910d78797b1d4dc1e2731ba93 /searchcore/src
parent69c515241adaeee6b2d2e44fe43ded074f3d67cc (diff)
Increase lifetime of FastAccessDocSubDBConfigurer.
Diffstat (limited to 'searchcore/src')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
index 0727dd493eb..4b66a340a03 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp
@@ -196,6 +196,9 @@ FastAccessDocSubDB::FastAccessDocSubDB(const Config &cfg, const Context &ctx)
_fastAccessAttributesOnly(cfg._fastAccessAttributesOnly),
_initAttrMgr(),
_fastAccessFeedView(),
+ _configurer(_fastAccessFeedView,
+ std::make_unique<AttributeWriterFactory>(),
+ getSubDbName()),
_subAttributeMetrics(ctx._subAttributeMetrics),
_addMetrics(cfg._addMetrics),
_metricsWireService(ctx._metricsWireService),
@@ -256,13 +259,11 @@ FastAccessDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const
if (params.shouldAttributeManagerChange() ||
params.shouldAttributeWriterChange() ||
newConfigSnapshot.getDocumentTypeRepoSP().get() != oldConfigSnapshot.getDocumentTypeRepoSP().get()) {
- FastAccessDocSubDBConfigurer configurer(_fastAccessFeedView,
- std::make_unique<AttributeWriterFactory>(), getSubDbName());
proton::IAttributeManager::SP oldMgr = extractAttributeManager(_fastAccessFeedView.get());
std::unique_ptr<AttributeCollectionSpec> attrSpec =
createAttributeSpec(newConfigSnapshot.getAttributesConfig(), alloc_strategy, serialNum);
IReprocessingInitializer::UP initializer =
- configurer.reconfigure(newConfigSnapshot, oldConfigSnapshot, std::move(*attrSpec));
+ _configurer.reconfigure(newConfigSnapshot, oldConfigSnapshot, std::move(*attrSpec));
if (initializer->hasReprocessors()) {
tasks.push_back(IReprocessingTask::SP(createReprocessingTask(*initializer,
newConfigSnapshot.getDocumentTypeRepoSP()).release()));
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
index 0ace6bab33f..23e66af9795 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h
@@ -70,6 +70,7 @@ private:
const bool _fastAccessAttributesOnly;
AttributeManager::SP _initAttrMgr;
Configurer::FeedViewVarHolder _fastAccessFeedView;
+ Configurer _configurer;
AttributeMetrics &_subAttributeMetrics;
std::shared_ptr<initializer::InitializerTask>