diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-08 17:17:33 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-08 17:17:33 +0000 |
commit | 11d358a64324317b3f63dae3be4cbe37f735473d (patch) | |
tree | 871a99384bdde651e3878157e7ee51f8bb04b904 /searchcore/src/tests/proton/documentdb | |
parent | 60a71bb8cc87d28c29e80242b82394bf634b224a (diff) |
Wire SessionManager via IDocumentSubDBOwner
Diffstat (limited to 'searchcore/src/tests/proton/documentdb')
-rw-r--r-- | searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp | 11 | ||||
-rw-r--r-- | searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 53ea1b3542f..e1f6e14e922 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() @@ -207,7 +209,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 +351,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 +436,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 +470,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 +585,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()); }); |