diff options
Diffstat (limited to 'searchcore/src/tests')
4 files changed, 18 insertions, 25 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index aff27959ec9..db15093e8b5 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -209,7 +209,7 @@ public: _configMgr.nextGeneration(0); if (! FastOS_File::MakeDirectory((std::string("tmpdb/") + docTypeName).c_str())) { abort(); } _ddb.reset(new DocumentDB("tmpdb", _configMgr.getConfig(), "tcp/localhost:9013", _queryLimiter, _clock, - DocTypeName(docTypeName), ProtonConfig(), *this, _summaryExecutor, _summaryExecutor, + DocTypeName(docTypeName), std::make_shared<ProtonConfig>(), *this, _summaryExecutor, _summaryExecutor, _tls, _dummy, _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore), std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo)), _ddb->start(); @@ -233,11 +233,8 @@ public: typedef DocumentMetaStore::Result PutRes; IDocumentMetaStore &dms = _ddb->getReadySubDB()->getDocumentMetaStoreContext().get(); uint32_t docSize = 1; - PutRes putRes(dms.put(docId.getGlobalId(), - BucketFactory::getBucketId(docId), - Timestamp(0u), - docSize, - lid)); + PutRes putRes(dms.put(docId.getGlobalId(), BucketFactory::getBucketId(docId), + Timestamp(0u), docSize, lid)); LOG_ASSERT(putRes.ok()); uint64_t serialNum = _ddb->getFeedHandler().incSerialNum(); _aw->put(serialNum, doc, lid, true, std::shared_ptr<IDestructorCallback>()); @@ -255,8 +252,7 @@ public: op.setDbDocumentId(dbdId); op.setPrevDbDocumentId(prevDbdId); _ddb->getFeedHandler().storeOperation(op); - SearchView *sv(dynamic_cast<SearchView *> - (_ddb->getReadySubDB()->getSearchView().get())); + SearchView *sv(dynamic_cast<SearchView *>(_ddb->getReadySubDB()->getSearchView().get())); if (sv != NULL) { // cf. FeedView::putAttributes() DocIdLimit &docIdLimit = sv->getDocIdLimit(); 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 b14eb9051d0..cd88666662e 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 @@ -262,25 +262,26 @@ struct MyConfigSnapshot Schema _schema; DocBuilder _builder; DocumentDBConfig::SP _cfg; + BootstrapConfig::SP _bootstrap; MyConfigSnapshot(const Schema &schema, const vespalib::string &cfgDir) : _schema(schema), _builder(_schema), - _cfg() + _cfg(), + _bootstrap() { DocumentDBConfig::DocumenttypesConfigSP documenttypesConfig (new DocumenttypesConfig(_builder.getDocumenttypesConfig())); TuneFileDocumentDB::SP tuneFileDocumentDB(new TuneFileDocumentDB()); - BootstrapConfig::SP bootstrap - (new BootstrapConfig(1, + _bootstrap = std::make_shared<BootstrapConfig>(1, documenttypesConfig, _builder.getDocumentTypeRepo(), std::make_shared<ProtonConfig>(), std::make_shared<FiledistributorrpcConfig>(), - tuneFileDocumentDB)); + tuneFileDocumentDB); config::DirSpec spec(cfgDir); DocumentDBConfigHelper mgr(spec, "searchdocument"); - mgr.forwardConfig(bootstrap); + mgr.forwardConfig(_bootstrap); mgr.nextGeneration(1); _cfg = mgr.getConfig(); } @@ -292,8 +293,8 @@ struct FixtureBase ExecutorThreadingService _writeService; ThreadStackExecutor _summaryExecutor; typename Traits::Config _cfg; - std::shared_ptr<BucketDBOwner> _bucketDB; - BucketDBHandler _bucketDBHandler; + std::shared_ptr<BucketDBOwner> _bucketDB; + BucketDBHandler _bucketDBHandler; typename Traits::Context _ctx; typename Traits::Schema _baseSchema; MyConfigSnapshot::UP _snapshot; @@ -354,12 +355,8 @@ struct FixtureBase cmpResult.documenttypesChanged = true; cmpResult.documentTypeRepoChanged = true; MyDocumentDBReferenceResolver resolver; - IReprocessingTask::List tasks = - _subDb.applyConfig(*newCfg->_cfg, - *_snapshot->_cfg, - serialNum, - ReconfigParams(cmpResult), - resolver); + auto tasks = _subDb.applyConfig(newCfg->_bootstrap->getProtonConfig(), *newCfg->_cfg, *_snapshot->_cfg, + serialNum, ReconfigParams(cmpResult), resolver); _snapshot = std::move(newCfg); if (!tasks.empty()) { ReprocessingRunner runner; diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index 157e964ad83..e15a44ff962 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -114,7 +114,7 @@ Fixture::Fixture() mgr.forwardConfig(b); mgr.nextGeneration(0); _db.reset(new DocumentDB(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, _clock, DocTypeName("typea"), - ProtonConfig(), _myDBOwner, _summaryExecutor, _summaryExecutor, _tls, _dummy, + b->getProtonConfigSP(), _myDBOwner, _summaryExecutor, _summaryExecutor, _tls, _dummy, _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore), std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo)); _db->start(); diff --git a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp index 757a9c19f29..ec14f7de818 100644 --- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp +++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp @@ -207,9 +207,9 @@ struct MyDocumentDBConfigOwner : public IDocumentDBConfigOwner _owner(owner) { } - virtual ~MyDocumentDBConfigOwner() { } + ~MyDocumentDBConfigOwner() { } - virtual void reconfigure(const DocumentDBConfig::SP & config) override; + void reconfigure(const std::shared_ptr<ProtonConfig> & protonConfig, const DocumentDBConfig::SP & config) override; }; struct MyProtonConfigurerOwner : public IProtonConfigurerOwner @@ -267,7 +267,7 @@ struct MyProtonConfigurerOwner : public IProtonConfigurerOwner }; void -MyDocumentDBConfigOwner::reconfigure(const DocumentDBConfig::SP & config) +MyDocumentDBConfigOwner::reconfigure(const std::shared_ptr<ProtonConfig> &,const DocumentDBConfig::SP & config) { _owner.reconfigureDocumentDB(_name, config); } |