aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-12-08 23:55:21 +0100
committerGitHub <noreply@github.com>2022-12-08 23:55:21 +0100
commit0f15b405cad738460a8126bf9ef689ec3edfd094 (patch)
treeca54173403ceb088b109649ee899f919411b48cf
parentc08e5c59f4162ee7ec1c8038e0e884486b8e8a62 (diff)
parente4c5580f64be5934d6b7690efc719d542c5be526 (diff)
Merge pull request #25178 from vespa-engine/balder/provide-sessionmanager-via-idocumentsubdbownerv8.97.26
Wire SessionManager via IDocumentSubDBOwner
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp26
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp58
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp12
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp10
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp35
-rw-r--r--searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp44
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.h9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/idocumentdbowner.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/matchview.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/matchview.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchview.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchview.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/CMakeLists.txt1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummydbowner.cpp25
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummydbowner.h (renamed from searchcore/src/tests/proton/common/dummydbowner.h)13
31 files changed, 161 insertions, 155 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp
index 0db14538630..52e2a314fd2 100644
--- a/searchcore/src/apps/tests/persistenceconformance_test.cpp
+++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp
@@ -1,21 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
-
-#include <tests/proton/common/dummydbowner.h>
-#include <vespa/config-attributes.h>
-#include <vespa/config-bucketspaces.h>
-#include <vespa/config-imported-fields.h>
-#include <vespa/config-indexschema.h>
-#include <vespa/config-rank-profiles.h>
-#include <vespa/config-summary.h>
-#include <vespa/config/subscription/sourcespec.h>
-#include <vespa/document/base/testdocman.h>
-#include <vespa/document/config/documenttypes_config_fwd.h>
-#include <vespa/document/repo/documenttyperepo.h>
-#include <vespa/document/test/make_bucket_space.h>
-#include <vespa/fastos/file.h>
#include <vespa/persistence/conformancetest/conformancetest.h>
+#include <vespa/searchcore/proton/test/dummydbowner.h>
#include <vespa/searchcore/proton/common/alloc_config.h>
#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchcore/proton/matching/querylimiter.h>
@@ -36,6 +23,17 @@
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
+#include <vespa/config-attributes.h>
+#include <vespa/config-bucketspaces.h>
+#include <vespa/config-imported-fields.h>
+#include <vespa/config-indexschema.h>
+#include <vespa/config-rank-profiles.h>
+#include <vespa/config-summary.h>
+#include <vespa/config/subscription/sourcespec.h>
+#include <vespa/document/base/testdocman.h>
+#include <vespa/document/config/documenttypes_config_fwd.h>
+#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/document/test/make_bucket_space.h>
#include <vespa/vespalib/util/size_literals.h>
#include <filesystem>
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 5b081fb5b51..9709530f2c2 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -1,6 +1,34 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <tests/proton/common/dummydbowner.h>
+#include <vespa/searchcore/proton/test/dummydbowner.h>
+#include <vespa/searchcore/proton/attribute/attribute_writer.h>
+#include <vespa/searchcore/proton/docsummary/docsumcontext.h>
+#include <vespa/searchcore/proton/docsummary/documentstoreadapter.h>
+#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
+#include <vespa/searchcore/proton/feedoperation/putoperation.h>
+#include <vespa/searchcore/proton/matching/querylimiter.h>
+#include <vespa/searchcore/proton/metrics/metricswireservice.h>
+#include <vespa/searchcore/proton/server/bootstrapconfig.h>
+#include <vespa/searchcore/proton/server/documentdb.h>
+#include <vespa/searchcore/proton/server/documentdbconfigmanager.h>
+#include <vespa/searchcore/proton/server/feedhandler.h>
+#include <vespa/searchcore/proton/server/idocumentsubdb.h>
+#include <vespa/searchcore/proton/server/memoryconfigstore.h>
+#include <vespa/searchcore/proton/server/searchview.h>
+#include <vespa/searchcore/proton/server/summaryadapter.h>
+#include <vespa/searchcore/proton/test/bucketfactory.h>
+#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
+#include <vespa/searchlib/attribute/interlock.h>
+#include <vespa/searchlib/engine/docsumapi.h>
+#include <vespa/searchlib/index/dummyfileheadercontext.h>
+#include <vespa/searchlib/tensor/tensor_attribute.h>
+#include <vespa/searchlib/test/doc_builder.h>
+#include <vespa/searchlib/transactionlog/nosyncproxy.h>
+#include <vespa/searchlib/transactionlog/translogserver.h>
+#include <vespa/searchsummary/docsummary/i_docsum_field_writer_factory.h>
+#include <vespa/searchsummary/docsummary/i_docsum_store_document.h>
+#include <vespa/searchsummary/docsummary/i_juniper_converter.h>
+#include <vespa/searchsummary/docsummary/linguisticsannotation.h>
#include <vespa/config-bucketspaces.h>
#include <vespa/config/helper/configgetter.hpp>
#include <vespa/document/annotation/annotation.h>
@@ -31,34 +59,6 @@
#include <vespa/eval/eval/tensor_spec.h>
#include <vespa/eval/eval/test/value_compare.h>
#include <vespa/eval/eval/value.h>
-#include <vespa/searchcore/proton/attribute/attribute_writer.h>
-#include <vespa/searchcore/proton/docsummary/docsumcontext.h>
-#include <vespa/searchcore/proton/docsummary/documentstoreadapter.h>
-#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
-#include <vespa/searchcore/proton/feedoperation/putoperation.h>
-#include <vespa/searchcore/proton/matching/querylimiter.h>
-#include <vespa/searchcore/proton/metrics/metricswireservice.h>
-#include <vespa/searchcore/proton/server/bootstrapconfig.h>
-#include <vespa/searchcore/proton/server/documentdb.h>
-#include <vespa/searchcore/proton/server/documentdbconfigmanager.h>
-#include <vespa/searchcore/proton/server/feedhandler.h>
-#include <vespa/searchcore/proton/server/idocumentsubdb.h>
-#include <vespa/searchcore/proton/server/memoryconfigstore.h>
-#include <vespa/searchcore/proton/server/searchview.h>
-#include <vespa/searchcore/proton/server/summaryadapter.h>
-#include <vespa/searchcore/proton/test/bucketfactory.h>
-#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
-#include <vespa/searchlib/attribute/interlock.h>
-#include <vespa/searchlib/engine/docsumapi.h>
-#include <vespa/searchlib/index/dummyfileheadercontext.h>
-#include <vespa/searchlib/tensor/tensor_attribute.h>
-#include <vespa/searchlib/test/doc_builder.h>
-#include <vespa/searchlib/transactionlog/nosyncproxy.h>
-#include <vespa/searchlib/transactionlog/translogserver.h>
-#include <vespa/searchsummary/docsummary/i_docsum_field_writer_factory.h>
-#include <vespa/searchsummary/docsummary/i_docsum_store_document.h>
-#include <vespa/searchsummary/docsummary/i_juniper_converter.h>
-#include <vespa/searchsummary/docsummary/linguisticsannotation.h>
#include <vespa/vespalib/data/simple_buffer.h>
#include <vespa/vespalib/data/slime/json_format.h>
#include <vespa/vespalib/data/slime/slime.h>
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 53ea1b3542f..600e4981c0f 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -155,6 +155,7 @@ struct Fixture
RankingAssetsRepo _constantValueRepo;
vespalib::ThreadStackExecutor _summaryExecutor;
std::shared_ptr<PendingLidTrackerBase> _pendingLidsForCommit;
+ SessionManager _sessionMgr;
ViewSet _views;
MyDocumentDBReferenceResolver _resolver;
ConfigurerUP _configurer;
@@ -170,6 +171,7 @@ Fixture::Fixture()
_constantValueRepo(_constantValueFactory),
_summaryExecutor(8, 128_Ki),
_pendingLidsForCommit(std::make_shared<PendingLidTracker>()),
+ _sessionMgr(100),
_views(),
_resolver(),
_configurer()
@@ -197,7 +199,6 @@ Fixture::initViewSet(ViewSet &views)
auto summaryMgr = make_shared<SummaryManager>
(_summaryExecutor, search::LogDocumentStore::Config(), search::GrowStrategy(), BASE_DIR,
TuneFileSummary(), views._fileHeaderContext,views._noTlSyncer, search::IBucketizer::SP());
- auto sesMgr = make_shared<SessionManager>(100);
auto metaStore = make_shared<DocumentMetaStoreContext>(make_shared<bucketdb::BucketDBOwner>());
auto indexWriter = std::make_shared<IndexWriter>(indexMgr);
auto attrWriter = std::make_shared<AttributeWriter>(attrMgr);
@@ -207,7 +208,7 @@ Fixture::initViewSet(ViewSet &views)
views._summaryMgr = summaryMgr;
views._dmsc = metaStore;
IndexSearchable::SP indexSearchable;
- auto matchView = std::make_shared<MatchView>(matchers, indexSearchable, attrMgr, sesMgr, metaStore, views._docIdLimit);
+ auto matchView = std::make_shared<MatchView>(matchers, indexSearchable, attrMgr, _sessionMgr, metaStore, views._docIdLimit);
views.searchView.set(SearchView::create
(summaryMgr->createSummarySetup(SummaryConfig(),
JuniperrcConfig(), views.repo, attrMgr),
@@ -349,9 +350,7 @@ struct SearchViewComparer
void expect_not_equal_attribute_manager() {
EXPECT_NOT_EQUAL(_old->getAttributeManager().get(), _new->getAttributeManager().get());
}
- void expect_equal_session_manager() {
- EXPECT_EQUAL(_old->getSessionManager().get(), _new->getSessionManager().get());
- }
+
void expect_equal_document_meta_store() {
EXPECT_EQUAL(_old->getDocumentMetaStore().get(), _new->getDocumentMetaStore().get());
}
@@ -436,7 +435,6 @@ TEST_F("require that we can reconfigure index searchable", Fixture)
cmp.expect_equal_matchers();
cmp.expect_not_equal_index_searchable();
cmp.expect_equal_attribute_manager();
- cmp.expect_equal_session_manager();
cmp.expect_equal_document_meta_store();
}
{ // verify feed view
@@ -471,7 +469,6 @@ TEST_F("require that we can reconfigure attribute manager", Fixture)
cmp.expect_not_equal_matchers();
cmp.expect_equal_index_searchable();
cmp.expect_not_equal_attribute_manager();
- cmp.expect_equal_session_manager();
cmp.expect_equal_document_meta_store();
}
{ // verify feed view
@@ -587,7 +584,6 @@ TEST_F("require that we can reconfigure matchers", Fixture)
cmp.expect_not_equal_matchers();
cmp.expect_equal_index_searchable();
cmp.expect_equal_attribute_manager();
- cmp.expect_equal_session_manager();
cmp.expect_equal_document_meta_store();
}
{ // verify feed view
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 43717fc724f..dd402a6e637 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -93,11 +93,18 @@ struct ConfigDir4 { static vespalib::string dir() { return TEST_PATH("cfg4"); }
struct MySubDBOwner : public IDocumentSubDBOwner
{
+ SessionManager _sessionMgr;
+ MySubDBOwner();
+ ~MySubDBOwner() override;
document::BucketSpace getBucketSpace() const override { return makeBucketSpace(); }
vespalib::string getName() const override { return "owner"; }
uint32_t getDistributionKey() const override { return -1; }
+ SessionManager & session_manager() override { return _sessionMgr; }
};
+MySubDBOwner::MySubDBOwner() : _sessionMgr(1) {}
+MySubDBOwner::~MySubDBOwner() = default;
+
struct MySyncProxy : public SyncProxy
{
void sync(SerialNum) override {}
@@ -354,8 +361,7 @@ struct FixtureBase
vespalib::ThreadStackExecutor executor(1, 1_Mi);
initializer::TaskRunner taskRunner(executor);
taskRunner.runTask(task);
- auto sessionMgr = std::make_shared<SessionManager>(1);
- runInMasterAndSync([&]() { _subDb.initViews(*_snapshot->_cfg, sessionMgr); });
+ runInMasterAndSync([&]() { _subDb.initViews(*_snapshot->_cfg); });
}
void basicReconfig(SerialNum serialNum) {
runInMasterAndSync([&]() { performReconfig(serialNum, make_all_attr_schema(two_attr_schema), ConfigDir2::dir()); });
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index 916f3106923..7aa18513f73 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -1,13 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <tests/proton/common/dummydbowner.h>
-#include <vespa/config-bucketspaces.h>
-#include <vespa/config/subscription/sourcespec.h>
-#include <vespa/document/config/documenttypes_config_fwd.h>
-#include <vespa/document/datatype/documenttype.h>
-#include <vespa/document/repo/documenttyperepo.h>
-#include <vespa/document/test/make_bucket_space.h>
-#include <vespa/fnet/transport.h>
+#include <vespa/searchcore/proton/test/dummydbowner.h>
#include <vespa/searchcore/proton/attribute/flushableattribute.h>
#include <vespa/searchcore/proton/common/statusreport.h>
#include <vespa/searchcore/proton/docsummary/summaryflushtarget.h>
@@ -18,6 +11,7 @@
#include <vespa/searchcore/proton/metrics/job_tracked_flush_target.h>
#include <vespa/searchcore/proton/metrics/metricswireservice.h>
#include <vespa/searchcore/proton/reference/i_document_db_reference.h>
+#include <vespa/searchcore/proton/reference/i_document_db_reference_registry.h>
#include <vespa/searchcore/proton/server/bootstrapconfig.h>
#include <vespa/searchcore/proton/server/document_db_explorer.h>
#include <vespa/searchcore/proton/server/documentdb.h>
@@ -27,6 +21,13 @@
#include <vespa/searchcore/proton/server/memoryconfigstore.h>
#include <vespa/searchcore/proton/test/mock_shared_threading_service.h>
#include <vespa/searchcorespi/index/indexflushtarget.h>
+#include <vespa/config-bucketspaces.h>
+#include <vespa/config/subscription/sourcespec.h>
+#include <vespa/document/config/documenttypes_config_fwd.h>
+#include <vespa/document/datatype/documenttype.h>
+#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/document/test/make_bucket_space.h>
+#include <vespa/fnet/transport.h>
#include <vespa/searchlib/attribute/attribute_read_guard.h>
#include <vespa/searchlib/attribute/interlock.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
@@ -78,22 +79,6 @@ config_subdir(SerialNum serialNum)
return os.str();
}
-struct MyDBOwner : public DummyDBOwner
-{
- std::shared_ptr<DocumentDBReferenceRegistry> _registry;
- MyDBOwner();
- ~MyDBOwner() override;
- std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override {
- return _registry;
- }
-};
-
-MyDBOwner::MyDBOwner()
- : DummyDBOwner(),
- _registry(std::make_shared<DocumentDBReferenceRegistry>())
-{}
-MyDBOwner::~MyDBOwner() = default;
-
struct FixtureBase {
bool _cleanup;
bool _file_config;
@@ -119,7 +104,7 @@ FixtureBase::~FixtureBase()
struct Fixture : public FixtureBase {
DummyWireService _dummy;
- MyDBOwner _myDBOwner;
+ DummyDBOwner _myDBOwner;
vespalib::ThreadStackExecutor _summaryExecutor;
MockSharedThreadingService _shared_service;
HwInfo _hwInfo;
diff --git a/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp b/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp
index a33d9682973..5e392b12f67 100644
--- a/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp
+++ b/searchcore/src/vespa/searchcore/bmcluster/bm_node.cpp
@@ -9,28 +9,7 @@
#include "bm_storage_link_context.h"
#include "i_bm_distribution.h"
#include "storage_api_rpc_bm_feed_handler.h"
-#include <tests/proton/common/dummydbowner.h>
-#include <vespa/config-attributes.h>
-#include <vespa/config-bucketspaces.h>
-#include <vespa/config-imported-fields.h>
-#include <vespa/config-indexschema.h>
-#include <vespa/config-persistence.h>
-#include <vespa/config-rank-profiles.h>
-#include <vespa/config-slobroks.h>
-#include <vespa/config-stor-distribution.h>
-#include <vespa/config-stor-filestor.h>
-#include <vespa/config-summary.h>
-#include <vespa/config-upgrading.h>
-#include <vespa/config/common/configcontext.h>
-#include <vespa/document/bucket/bucketspace.h>
-#include <vespa/document/config/documenttypes_config_fwd.h>
-#include <vespa/document/repo/configbuilder.h>
-#include <vespa/document/repo/document_type_repo_factory.h>
-#include <vespa/document/repo/documenttyperepo.h>
-#include <vespa/document/test/make_bucket_space.h>
-#include <vespa/messagebus/config-messagebus.h>
-#include <vespa/messagebus/testlib/slobrok.h>
-#include <vespa/metrics/config-metricsmanager.h>
+#include <vespa/searchcore/proton/test/dummydbowner.h>
#include <vespa/searchcore/proton/common/alloc_config.h>
#include <vespa/searchcore/proton/matching/querylimiter.h>
#include <vespa/searchcore/proton/metrics/metricswireservice.h>
@@ -70,6 +49,27 @@
#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/size_literals.h>
+#include <vespa/config-attributes.h>
+#include <vespa/config-bucketspaces.h>
+#include <vespa/config-imported-fields.h>
+#include <vespa/config-indexschema.h>
+#include <vespa/config-persistence.h>
+#include <vespa/config-rank-profiles.h>
+#include <vespa/config-slobroks.h>
+#include <vespa/config-stor-distribution.h>
+#include <vespa/config-stor-filestor.h>
+#include <vespa/config-summary.h>
+#include <vespa/config-upgrading.h>
+#include <vespa/config/common/configcontext.h>
+#include <vespa/document/bucket/bucketspace.h>
+#include <vespa/document/config/documenttypes_config_fwd.h>
+#include <vespa/document/repo/configbuilder.h>
+#include <vespa/document/repo/document_type_repo_factory.h>
+#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/document/test/make_bucket_space.h>
+#include <vespa/messagebus/config-messagebus.h>
+#include <vespa/messagebus/testlib/slobrok.h>
+#include <vespa/metrics/config-metricsmanager.h>
#include <filesystem>
#include <vespa/log/log.h>
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp
index 2535b518335..f333af19ed3 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp
+++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp
@@ -2,7 +2,6 @@
#include "documentdb_tagged_metrics.h"
#include <vespa/vespalib/util/stringfmt.h>
-#include <vespa/vespalib/util/exceptions.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.metrics.documentdb_tagged_metrics");
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index 1b91f9ec0c2..427f40d6116 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -340,7 +340,7 @@ DocumentDB::initFinish(DocumentDBConfig::SP configSnapshot)
// Called by executor thread
assert(_writeService.master().isCurrentThread());
_bucketHandler.setReadyBucketHandler(_subDBs.getReadySubDB()->getDocumentMetaStoreContext().get());
- _subDBs.initViews(*configSnapshot, _sessionManager);
+ _subDBs.initViews(*configSnapshot);
syncFeedView();
// Check that feed view has been activated.
assert(_feedView.get());
@@ -1120,4 +1120,9 @@ DocumentDB::set_attribute_usage_listener(std::unique_ptr<IAttributeUsageListener
_writeFilter.set_listener(std::move(listener));
}
+matching::SessionManager &
+DocumentDB::session_manager() {
+ return *_sessionManager;
+}
+
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
index bec1b88c0c9..2932d21b47e 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
@@ -253,14 +253,6 @@ public:
const HwInfo &hwInfo);
/**
- * Expose a cost view of the session manager. This is used by the
- * document db explorer.
- **/
- const matching::SessionManager &session_manager() const {
- return *_sessionManager;
- }
-
- /**
* Frees any allocated resources. This will also stop the internal thread
* and wait for it to finish. All pending tasks are deleted.
*/
@@ -392,6 +384,7 @@ public:
document::BucketSpace getBucketSpace() const override;
vespalib::string getName() const override;
uint32_t getDistributionKey() const override;
+ matching::SessionManager &session_manager() override;
/**
* Implements IFeedHandlerOwner
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
index 3fe7fd6cfde..6b97d41e459 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb_metrics_updater.cpp
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "documentdb_metrics_updater.h"
-#include "ddbstate.h"
#include "document_meta_store_read_guards.h"
#include "documentsubdbcollection.h"
#include "executorthreadingservice.h"
@@ -12,7 +11,6 @@
#include <vespa/searchcore/proton/attribute/i_attribute_manager.h>
#include <vespa/searchcore/proton/docsummary/isummarymanager.h>
#include <vespa/searchcore/proton/matching/matching_stats.h>
-#include <vespa/searchcore/proton/matching/matching_stats.h>
#include <vespa/searchcore/proton/metrics/documentdb_job_trackers.h>
#include <vespa/searchcore/proton/metrics/executor_threading_service_stats.h>
#include <vespa/searchlib/attribute/attributevector.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index e7685624f55..103234f7529 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -12,7 +12,6 @@
#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
-using proton::matching::SessionManager;
using search::GrowStrategy;
using search::SerialNum;
using search::index::Schema;
@@ -184,11 +183,10 @@ DocumentSubDBCollection::createInitializer(const DocumentDBConfig &configSnapsho
void
-DocumentSubDBCollection::initViews(const DocumentDBConfig &configSnapshot,
- const SessionManager::SP &sessionManager)
+DocumentSubDBCollection::initViews(const DocumentDBConfig &configSnapshot)
{
for (auto subDb : _subDBs) {
- subDb->initViews(configSnapshot, sessionManager);
+ subDb->initViews(configSnapshot);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
index 8c1e670454c..a5ab1b5971c 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
@@ -46,10 +46,7 @@ struct IBucketStateCalculator;
struct IDocumentDBReferenceResolver;
struct MetricsWireService;
-namespace matching {
- class QueryLimiter;
- class SessionManager;
-}
+namespace matching { class QueryLimiter; }
namespace initializer { class InitializerTask; }
@@ -65,7 +62,6 @@ public:
private:
using IFeedViewSP = std::shared_ptr<IFeedView>;
using IBucketStateCalculatorSP = std::shared_ptr<IBucketStateCalculator>;
- using SessionManagerSP = std::shared_ptr<matching::SessionManager>;
using IFlushTargetList = std::vector<std::shared_ptr<searchcorespi::IFlushTarget>>;
SubDBVector _subDBs;
IDocumentSubDBOwner &_owner;
@@ -131,7 +127,7 @@ public:
createInitializer(const DocumentDBConfig &configSnapshot, SerialNum configSerialNum,
const index::IndexConfig & indexCfg);
- void initViews(const DocumentDBConfig &configSnapshot, const SessionManagerSP &sessionManager);
+ void initViews(const DocumentDBConfig &configSnapshot);
void clearViews();
void onReplayDone();
void onReprocessDone(SerialNum serialNum);
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 7fd54f111e1..6c684ce4c99 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
@@ -230,8 +230,7 @@ FastAccessDocSubDB::setup(const DocumentSubDbInitializerResult &initResult)
}
void
-FastAccessDocSubDB::initViews(const DocumentDBConfig &configSnapshot,
- const SessionManager::SP &)
+FastAccessDocSubDB::initViews(const DocumentDBConfig &configSnapshot)
{
// Called by executor thread
_iSearchView.set(std::make_shared<EmptySearchView>());
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 94fca94c75d..2d00a2a412c 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
@@ -84,7 +84,6 @@ private:
protected:
using Parent = StoreOnlyDocSubDB;
- using SessionManagerSP = std::shared_ptr<matching::SessionManager>;
const bool _addMetrics;
MetricsWireService &_metricsWireService;
@@ -108,7 +107,7 @@ public:
const IndexConfig &indexCfg) const override;
void setup(const DocumentSubDbInitializerResult &initResult) override;
- void initViews(const DocumentDBConfig &configSnapshot, const SessionManagerSP &sessionManager) override;
+ void initViews(const DocumentDBConfig &configSnapshot) override;
IReprocessingTask::List
applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot,
diff --git a/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h b/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h
index 4bd143a077e..e170840e252 100644
--- a/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h
+++ b/searchcore/src/vespa/searchcore/proton/server/i_document_subdb_owner.h
@@ -7,6 +7,8 @@
namespace proton {
+namespace matching { class SessionManager; }
+
/**
* Interface defining the communication needed with the owner of the
* document sub db.
@@ -14,10 +16,12 @@ namespace proton {
class IDocumentSubDBOwner
{
public:
+ using SessionManager = matching::SessionManager;
virtual ~IDocumentSubDBOwner() {}
virtual document::BucketSpace getBucketSpace() const = 0;
virtual vespalib::string getName() const = 0;
virtual uint32_t getDistributionKey() const = 0;
+ virtual SessionManager & session_manager() = 0;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/idocumentdbowner.h b/searchcore/src/vespa/searchcore/proton/server/idocumentdbowner.h
index dc060f6a84b..36ac3427e66 100644
--- a/searchcore/src/vespa/searchcore/proton/server/idocumentdbowner.h
+++ b/searchcore/src/vespa/searchcore/proton/server/idocumentdbowner.h
@@ -8,14 +8,17 @@
namespace proton {
class IDocumentDBReferenceRegistry;
+namespace matching { class SessionManager; }
class IDocumentDBOwner
{
public:
+ using SessionManager = matching::SessionManager;
virtual ~IDocumentDBOwner();
virtual bool isInitializing() const = 0;
virtual uint32_t getDistributionKey() const = 0;
+ virtual SessionManager & session_manager() = 0;
virtual std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const = 0;
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h
index b945c67660b..c6410073c09 100644
--- a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h
@@ -63,6 +63,7 @@ public:
using IFlushTargetList = std::vector<std::shared_ptr<searchcorespi::IFlushTarget>>;
using IndexConfig = index::IndexConfig;
using OnDone = std::shared_ptr<vespalib::IDestructorCallback>;
+ using SessionManager = matching::SessionManager;
public:
IDocumentSubDB() { }
virtual ~IDocumentSubDB() { }
@@ -75,7 +76,7 @@ public:
// Called by master thread
virtual void setup(const DocumentSubDbInitializerResult &initResult) = 0;
- virtual void initViews(const DocumentDBConfig &configSnapshot, const std::shared_ptr<matching::SessionManager> &sessionManager) = 0;
+ virtual void initViews(const DocumentDBConfig &configSnapshot) = 0;
virtual IReprocessingTask::List
applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot,
diff --git a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp
index bd9c927e94e..532c2e868b6 100644
--- a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp
@@ -36,13 +36,13 @@ using matching::SessionManager;
MatchView::MatchView(Matchers::SP matchers,
IndexSearchable::SP indexSearchable,
IAttributeManager::SP attrMgr,
- SessionManagerSP sessionMgr,
+ SessionManager & sessionMgr,
IDocumentMetaStoreContext::SP metaStore,
DocIdLimit &docIdLimit)
: _matchers(std::move(matchers)),
_indexSearchable(std::move(indexSearchable)),
_attrMgr(std::move(attrMgr)),
- _sessionMgr(std::move(sessionMgr)),
+ _sessionMgr(sessionMgr),
_metaStore(std::move(metaStore)),
_docIdLimit(docIdLimit)
{ }
@@ -75,7 +75,7 @@ MatchView::match(std::shared_ptr<const ISearchHandler> searchHandler, const Sear
const search::IDocumentMetaStore & dms = owned_objects.readGuard->get();
const bucketdb::BucketDBOwner & bucketDB = _metaStore->get().getBucketDB();
return matcher->match(req, threadBundle, ctx->getSearchContext(), ctx->getAttributeContext(),
- *_sessionMgr, dms, bucketDB, std::move(owned_objects));
+ _sessionMgr, dms, bucketDB, std::move(owned_objects));
}
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/matchview.h b/searchcore/src/vespa/searchcore/proton/server/matchview.h
index f7bf0abff39..603d929b407 100644
--- a/searchcore/src/vespa/searchcore/proton/server/matchview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/matchview.h
@@ -18,11 +18,11 @@ namespace matching {
}
class MatchView {
- using SessionManagerSP = std::shared_ptr<matching::SessionManager>;
+ using SessionManager = matching::SessionManager;
Matchers::SP _matchers;
searchcorespi::IndexSearchable::SP _indexSearchable;
IAttributeManager::SP _attrMgr;
- SessionManagerSP _sessionMgr;
+ SessionManager & _sessionMgr;
IDocumentMetaStoreContext::SP _metaStore;
DocIdLimit &_docIdLimit;
@@ -38,7 +38,7 @@ public:
MatchView(Matchers::SP matchers,
searchcorespi::IndexSearchable::SP indexSearchable,
IAttributeManager::SP attrMgr,
- SessionManagerSP sessionMgr,
+ SessionManager & sessionMgr,
IDocumentMetaStoreContext::SP metaStore,
DocIdLimit &docIdLimit);
~MatchView();
@@ -46,7 +46,7 @@ public:
const Matchers::SP & getMatchers() const { return _matchers; }
const searchcorespi::IndexSearchable::SP & getIndexSearchable() const { return _indexSearchable; }
const IAttributeManager::SP & getAttributeManager() const { return _attrMgr; }
- const SessionManagerSP & getSessionManager() const { return _sessionMgr; }
+ SessionManager & getSessionManager() const { return _sessionMgr; }
const IDocumentMetaStoreContext::SP & getDocumentMetaStore() const { return _metaStore; }
DocIdLimit & getDocIdLimit() const { return _docIdLimit; }
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 3635aba9e10..3b1a88774b7 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -997,6 +997,12 @@ Proton::getDocumentDBReferenceRegistry() const
return _documentDBReferenceRegistry;
}
+matching::SessionManager &
+Proton::session_manager() {
+ // Temporary and will not be called used yet
+ abort();
+}
+
storage::spi::PersistenceProvider &
Proton::getPersistence()
{
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.h b/searchcore/src/vespa/searchcore/proton/server/proton.h
index 0d4b067eea1..235bd120821 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.h
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.h
@@ -141,6 +141,7 @@ private:
uint32_t getDistributionKey() const override { return _distributionKey; }
BootstrapConfig::SP getActiveConfigSnapshot() const;
std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override;
+ SessionManager & session_manager() override;
// Returns true if the node is up in _any_ bucket space
bool updateNodeUp(BucketSpace bucketSpace, bool nodeUpInBucketSpace);
void closeDocumentDBs(vespalib::ThreadStackExecutorBase & executor);
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
index 043e9cd5d3f..3d87e7dc7c3 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
@@ -10,7 +10,6 @@
#include <vespa/searchcore/proton/flushengine/threadedflushtarget.h>
#include <vespa/searchcore/proton/index/index_manager_initializer.h>
#include <vespa/searchcore/proton/index/index_writer.h>
-#include <vespa/searchcore/proton/matching/sessionmanager.h>
#include <vespa/searchcore/proton/reference/document_db_reference.h>
#include <vespa/searchcore/proton/reference/gid_to_lid_change_handler.h>
#include <vespa/searchlib/fef/indexproperties.h>
@@ -19,7 +18,6 @@
using vespa::config::search::RankProfilesConfig;
using proton::matching::MatchingStats;
-using proton::matching::SessionManager;
using search::GrowStrategy;
using search::index::Schema;
using search::SerialNum;
@@ -187,7 +185,7 @@ SearchableDocSubDB::setBucketStateCalculator(const std::shared_ptr<IBucketStateC
}
void
-SearchableDocSubDB::initViews(const DocumentDBConfig &configSnapshot, const SessionManager::SP &sessionManager)
+SearchableDocSubDB::initViews(const DocumentDBConfig &configSnapshot)
{
assert(_writeService.master().isCurrentThread());
@@ -199,7 +197,7 @@ SearchableDocSubDB::initViews(const DocumentDBConfig &configSnapshot, const Sess
configSnapshot.getOnnxModelsSP());
Matchers::SP matchers = _configurer.createMatchers(schema, configSnapshot.getRankProfilesConfig());
auto matchView = std::make_shared<MatchView>(std::move(matchers), indexMgr->getSearchable(), attrMgr,
- sessionManager, _metaStoreCtx, _docIdLimit);
+ _owner.session_manager(), _metaStoreCtx, _docIdLimit);
_rSearchView.set(SearchView::create(
getSummaryManager()->createSummarySetup(
configSnapshot.getSummaryConfig(),
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
index c628d9a96b7..dcfe0b32f4a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
@@ -100,7 +100,7 @@ public:
const IndexConfig &indexCfg) const override;
void setup(const DocumentSubDbInitializerResult &initResult) override;
- void initViews(const DocumentDBConfig &configSnapshot, const SessionManagerSP &sessionManager) override;
+ void initViews(const DocumentDBConfig &configSnapshot) override;
IReprocessingTask::List
applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot,
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
index a17415db474..7a909bbebd8 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp
@@ -34,7 +34,6 @@ convertGidsToLids(const DocsumRequest & request,
const search::IDocumentMetaStore &metaStore,
uint32_t docIdLimit)
{
- document::GlobalId empty;
uint32_t lid = 0;
for (size_t i = 0; i < request.hits.size(); ++i) {
const DocsumRequest::Hit & h = request.hits[i];
@@ -128,7 +127,7 @@ SearchView::getDocsumsInternal(const DocsumRequest & req)
MatchContext::UP mctx = _matchView->createContext();
auto ctx = std::make_unique<DocsumContext>(req, _summarySetup->getDocsumWriter(), *store, _matchView->getMatcher(req.ranking),
mctx->getSearchContext(), mctx->getAttributeContext(),
- *_summarySetup->getAttributeManager(), *getSessionManager());
+ *_summarySetup->getAttributeManager(), getSessionManager());
SearchView::InternalDocsumReply reply(ctx->getDocsums(), true);
uint64_t endGeneration = readGuard->get().getCurrentGeneration();
if (startGeneration != endGeneration) {
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchview.h b/searchcore/src/vespa/searchcore/proton/server/searchview.h
index c8174c0a9a6..8c9f6cffa94 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchview.h
@@ -11,7 +11,7 @@ namespace proton {
class SearchView : public ISearchHandler, public std::enable_shared_from_this<SearchView>
{
public:
- using SessionManagerSP = std::shared_ptr<matching::SessionManager>;
+ using SessionManager = matching::SessionManager;
using IndexSearchable = searchcorespi::IndexSearchable;
using InternalDocsumReply = std::pair<std::unique_ptr<DocsumReply>, bool>;
typedef std::shared_ptr<SearchView> SP;
@@ -28,7 +28,7 @@ public:
const Matchers::SP & getMatchers() const { return _matchView->getMatchers(); }
const IndexSearchable::SP & getIndexSearchable() const { return _matchView->getIndexSearchable(); }
const IAttributeManager::SP & getAttributeManager() const { return _matchView->getAttributeManager(); }
- const SessionManagerSP & getSessionManager() const { return _matchView->getSessionManager(); }
+ SessionManager & getSessionManager() const { return _matchView->getSessionManager(); }
const IDocumentMetaStoreContext::SP & getDocumentMetaStore() const { return _matchView->getDocumentMetaStore(); }
DocIdLimit &getDocIdLimit() const { return _matchView->getDocIdLimit(); }
matching::MatchingStats getMatcherStats(const vespalib::string &rankProfile) const { return _matchView->getMatcherStats(rankProfile); }
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
index 9419dfa1c90..e95c98e2740 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
@@ -356,7 +356,7 @@ StoreOnlyDocSubDB::getFeedViewPersistentParams()
}
void
-StoreOnlyDocSubDB::initViews(const DocumentDBConfig &configSnapshot, const SessionManager::SP &sessionManager)
+StoreOnlyDocSubDB::initViews(const DocumentDBConfig &configSnapshot)
{
assert(_writeService.master().isCurrentThread());
_iSearchView.set(std::make_shared<EmptySearchView>());
@@ -364,7 +364,6 @@ StoreOnlyDocSubDB::initViews(const DocumentDBConfig &configSnapshot, const Sessi
std::lock_guard<std::mutex> guard(_configMutex);
initFeedView(configSnapshot);
}
- (void) sessionManager;
}
void
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h
index f694cc7298f..5a8db23e345 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h
@@ -196,7 +196,7 @@ public:
const IndexConfig & indexCfg) const override;
void setup(const DocumentSubDbInitializerResult &initResult) override;
- void initViews(const DocumentDBConfig &configSnapshot, const std::shared_ptr<matching::SessionManager> &sessionManager) override;
+ void initViews(const DocumentDBConfig &configSnapshot) override;
void validateDocStore(FeedHandler & feedHandler, SerialNum serialNum) const override;
diff --git a/searchcore/src/vespa/searchcore/proton/test/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/test/CMakeLists.txt
index ad86ce64d8e..79b0582e1d0 100644
--- a/searchcore/src/vespa/searchcore/proton/test/CMakeLists.txt
+++ b/searchcore/src/vespa/searchcore/proton/test/CMakeLists.txt
@@ -10,6 +10,7 @@ vespa_add_library(searchcore_test STATIC
documentdb_config_builder.cpp
dummy_feed_view.cpp
dummy_flush_target.cpp
+ dummydbowner.cpp
mock_index_manager.cpp
mock_shared_threading_service.cpp
userdocumentsbuilder.cpp
diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h
index 6c142c97aaf..c29af41cdd3 100644
--- a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h
+++ b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h
@@ -51,7 +51,7 @@ struct DummyDocumentSubDb : public IDocumentSubDB
(const_cast<DummyDocumentSubDb &>(*this), _service.write().master());
}
void setup(const DocumentSubDbInitializerResult &) override {}
- void initViews(const DocumentDBConfig &, const proton::matching::SessionManager::SP &) override {}
+ void initViews(const DocumentDBConfig &) override {}
IReprocessingTask::List applyConfig(const DocumentDBConfig &, const DocumentDBConfig &,
SerialNum, const ReconfigParams &, IDocumentDBReferenceResolver &) override
{
diff --git a/searchcore/src/vespa/searchcore/proton/test/dummydbowner.cpp b/searchcore/src/vespa/searchcore/proton/test/dummydbowner.cpp
new file mode 100644
index 00000000000..d91d0261006
--- /dev/null
+++ b/searchcore/src/vespa/searchcore/proton/test/dummydbowner.cpp
@@ -0,0 +1,25 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "dummydbowner.h"
+#include <vespa/searchcore/proton/reference/document_db_reference_registry.h>
+#include <vespa/searchcore/proton/matching/sessionmanager.h>
+
+namespace proton {
+
+DummyDBOwner::DummyDBOwner()
+ : _registry(std::make_shared<DocumentDBReferenceRegistry>()),
+ _sessionManager(std::make_unique<SessionManager>(10))
+{}
+DummyDBOwner::~DummyDBOwner() = default;
+
+std::shared_ptr<IDocumentDBReferenceRegistry>
+DummyDBOwner::getDocumentDBReferenceRegistry() const {
+ return _registry;
+}
+
+matching::SessionManager &
+DummyDBOwner::session_manager() {
+ return *_sessionManager;
+}
+
+}
diff --git a/searchcore/src/tests/proton/common/dummydbowner.h b/searchcore/src/vespa/searchcore/proton/test/dummydbowner.h
index 1fa9c17257c..99ccb0ab56d 100644
--- a/searchcore/src/tests/proton/common/dummydbowner.h
+++ b/searchcore/src/vespa/searchcore/proton/test/dummydbowner.h
@@ -3,25 +3,22 @@
#pragma once
#include <vespa/searchcore/proton/server/idocumentdbowner.h>
-#include <vespa/searchcore/proton/reference/document_db_reference_registry.h>
#include <vespa/vespalib/stllike/string.h>
namespace proton {
struct DummyDBOwner : IDocumentDBOwner {
std::shared_ptr<IDocumentDBReferenceRegistry> _registry;
+ std::unique_ptr<SessionManager> _sessionManager;
- DummyDBOwner()
- : _registry(std::make_shared<DocumentDBReferenceRegistry>())
- {}
- ~DummyDBOwner() {}
+ DummyDBOwner();
+ ~DummyDBOwner() override;
bool isInitializing() const override { return false; }
uint32_t getDistributionKey() const override { return -1; }
- std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override {
- return _registry;
- }
+ std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override;
+ SessionManager & session_manager() override;
};
} // namespace proton