From 8cfeaeba255ccea54f8345724e72adf53280e33d Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 4 Apr 2018 11:45:55 +0000 Subject: Stop using nested typedef for shared pointer to const DocumentTypeRepo. --- document/src/vespa/document/repo/documenttyperepo.h | 1 - memfilepersistence/src/tests/spi/memfiletestutils.h | 2 +- memfilepersistence/src/tests/spi/providerconformancetest.cpp | 2 +- .../src/vespa/memfilepersistence/tools/dumpslotfile.cpp | 2 +- persistence/src/tests/dummyimpl/dummyimpltest.cpp | 2 +- persistence/src/tests/dummyimpl/dummypersistence_test.cpp | 2 +- .../src/vespa/persistence/conformancetest/conformancetest.h | 2 +- .../src/vespa/persistence/dummyimpl/dummypersistence.cpp | 2 +- persistence/src/vespa/persistence/dummyimpl/dummypersistence.h | 4 ++-- searchcore/src/apps/tests/persistenceconformance_test.cpp | 10 +++++----- searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp | 10 +++++----- searchcore/src/tests/proton/docsummary/docsummary.cpp | 6 +++--- .../src/tests/proton/docsummary/summaryfieldconverter_test.cpp | 2 +- .../documentdb/combiningfeedview/combiningfeedview_test.cpp | 4 ++-- .../src/tests/proton/documentdb/configurer/configurer_test.cpp | 8 ++++---- .../documentbucketmover/documentbucketmover_test.cpp | 8 ++++---- searchcore/src/tests/proton/documentdb/documentdb_test.cpp | 2 +- .../documentdb/documentdbconfig/documentdbconfig_test.cpp | 6 +++--- .../tests/proton/documentdb/feedhandler/feedhandler_test.cpp | 6 +++--- .../src/tests/proton/documentdb/feedview/feedview_test.cpp | 2 +- .../documentdb/fileconfigmanager/fileconfigmanager_test.cpp | 2 +- .../lid_space_compaction/lid_space_compaction_test.cpp | 8 ++++---- .../maintenancecontroller/maintenancecontroller_test.cpp | 6 +++--- .../documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp | 4 ++-- .../src/tests/proton/feedoperation/feedoperation_test.cpp | 2 +- .../tests/proton/proton_configurer/proton_configurer_test.cpp | 4 ++-- searchcore/src/tests/proton/server/feedstates_test.cpp | 4 ++-- .../src/vespa/searchcore/proton/docsummary/isummarymanager.h | 2 +- .../src/vespa/searchcore/proton/docsummary/summarymanager.cpp | 4 ++-- .../src/vespa/searchcore/proton/docsummary/summarymanager.h | 6 +++--- .../proton/reprocessing/reprocess_documents_task.cpp | 2 +- .../searchcore/proton/reprocessing/reprocess_documents_task.h | 4 ++-- .../src/vespa/searchcore/proton/server/bootstrapconfig.cpp | 2 +- .../src/vespa/searchcore/proton/server/bootstrapconfig.h | 6 +++--- .../vespa/searchcore/proton/server/bootstrapconfigmanager.cpp | 2 +- .../src/vespa/searchcore/proton/server/combiningfeedview.cpp | 6 +++--- .../src/vespa/searchcore/proton/server/combiningfeedview.h | 4 ++-- .../src/vespa/searchcore/proton/server/documentdbconfig.cpp | 2 +- .../src/vespa/searchcore/proton/server/documentdbconfig.h | 6 +++--- .../vespa/searchcore/proton/server/fast_access_doc_subdb.cpp | 2 +- .../src/vespa/searchcore/proton/server/fast_access_doc_subdb.h | 2 +- .../proton/server/fast_access_doc_subdb_configurer.cpp | 2 +- .../proton/server/fast_access_doc_subdb_configurer.h | 2 +- .../src/vespa/searchcore/proton/server/fileconfigmanager.cpp | 2 +- .../searchcore/proton/server/minimal_document_retriever.cpp | 2 +- .../searchcore/proton/server/minimal_document_retriever.h | 4 ++-- searchcore/src/vespa/searchcore/proton/server/proton.cpp | 4 ++-- .../proton/server/searchable_doc_subdb_configurer.cpp | 2 +- .../searchcore/proton/server/searchable_doc_subdb_configurer.h | 2 +- .../src/vespa/searchcore/proton/server/storeonlyfeedview.h | 8 ++++---- .../vespa/searchcore/proton/test/documentdb_config_builder.h | 4 ++-- searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h | 6 +++--- .../src/vespa/searchcore/proton/test/dummy_summary_manager.h | 2 +- .../src/vespa/searchcore/proton/test/userdocumentsbuilder.h | 2 +- searchlib/src/vespa/searchlib/index/docbuilder.h | 4 ++-- storage/src/tests/bucketdb/bucketmanagertest.cpp | 2 +- storage/src/tests/common/teststorageapp.cpp | 2 +- storage/src/tests/common/teststorageapp.h | 4 ++-- storage/src/tests/distributor/distributortestutil.cpp | 2 +- storage/src/tests/distributor/distributortestutil.h | 2 +- storage/src/tests/distributor/getoperationtest.cpp | 2 +- storage/src/tests/distributor/operationtargetresolvertest.cpp | 2 +- storage/src/tests/distributor/putoperationtest.cpp | 2 +- storage/src/tests/distributor/twophaseupdateoperationtest.cpp | 2 +- storage/src/tests/distributor/updateoperationtest.cpp | 2 +- storage/src/tests/persistence/persistencetestutils.h | 2 +- storage/src/tests/storageserver/documentapiconvertertest.cpp | 2 +- .../operations/external/removelocationoperation.cpp | 2 +- .../frameworkimpl/component/storagecomponentregisterimpl.cpp | 2 +- .../frameworkimpl/component/storagecomponentregisterimpl.h | 6 +++--- .../src/vespa/storage/storageserver/communicationmanager.cpp | 2 +- storage/src/vespa/storage/storageserver/communicationmanager.h | 2 +- storage/src/vespa/storage/storageserver/storagenode.cpp | 2 +- storage/src/vespa/storage/visiting/visitorthread.cpp | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization.cpp | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization.h | 6 +++--- .../src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization4_2.h | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization5_0.h | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization5_1.h | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization5_2.h | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp | 2 +- .../src/vespa/storageapi/mbusprot/protocolserialization6_0.h | 2 +- storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp | 2 +- storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h | 2 +- storageserver/src/tests/storageservertest.cpp | 4 ++-- vespaclient/src/vespa/vespaclient/vesparoute/application.cpp | 2 +- 89 files changed, 144 insertions(+), 145 deletions(-) diff --git a/document/src/vespa/document/repo/documenttyperepo.h b/document/src/vespa/document/repo/documenttyperepo.h index 3d4caee15c6..ce54effe068 100644 --- a/document/src/vespa/document/repo/documenttyperepo.h +++ b/document/src/vespa/document/repo/documenttyperepo.h @@ -23,7 +23,6 @@ class DocumentTypeRepo { public: using DocumenttypesConfig = const internal::InternalDocumenttypesType; - typedef std::shared_ptr SP; typedef std::unique_ptr UP; // This one should only be used for testing. If you do not have any config. diff --git a/memfilepersistence/src/tests/spi/memfiletestutils.h b/memfilepersistence/src/tests/spi/memfiletestutils.h index 450d87451b9..657b116b6e5 100644 --- a/memfilepersistence/src/tests/spi/memfiletestutils.h +++ b/memfilepersistence/src/tests/spi/memfiletestutils.h @@ -191,7 +191,7 @@ public: const document::DocumentId& id, const document::FieldValue& updateValue); - virtual const document::DocumentTypeRepo::SP getTypeRepo() const + virtual const std::shared_ptr getTypeRepo() const { return document::TestDocMan::getTypeRepoSP(); } /** diff --git a/memfilepersistence/src/tests/spi/providerconformancetest.cpp b/memfilepersistence/src/tests/spi/providerconformancetest.cpp index 625549f0008..7ba91bde619 100644 --- a/memfilepersistence/src/tests/spi/providerconformancetest.cpp +++ b/memfilepersistence/src/tests/spi/providerconformancetest.cpp @@ -20,7 +20,7 @@ struct ProviderConformanceTest : public spi::ConformanceTest { } spi::PersistenceProvider::UP - getPersistenceImplementation(const document::DocumentTypeRepo::SP& repo, + getPersistenceImplementation(const std::shared_ptr& repo, const document::DocumenttypesConfig&) override { system("rm -rf vdsroot"); diff --git a/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp b/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp index 9781c28823d..b267fff0ab0 100644 --- a/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp +++ b/memfilepersistence/src/vespa/memfilepersistence/tools/dumpslotfile.cpp @@ -144,7 +144,7 @@ namespace { MemFileMapper _mapper; DeviceManager _deviceManager; document::DocumentType _docType; - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; vespa::config::storage::StorMemfilepersistenceConfigBuilder _memFileConfig; vespa::config::content::PersistenceConfigBuilder _persistenceConfig; vespa::config::storage::StorDevicesConfigBuilder _deviceConfig; diff --git a/persistence/src/tests/dummyimpl/dummyimpltest.cpp b/persistence/src/tests/dummyimpl/dummyimpltest.cpp index 699a3a336a7..915d3e6a4b2 100644 --- a/persistence/src/tests/dummyimpl/dummyimpltest.cpp +++ b/persistence/src/tests/dummyimpl/dummyimpltest.cpp @@ -12,7 +12,7 @@ struct DummyImplTest : public ConformanceTest { using Repo = document::DocumentTypeRepo; PersistenceProvider::UP - getPersistenceImplementation(const Repo::SP& repo, const Repo::DocumenttypesConfig&) override { + getPersistenceImplementation(const std::shared_ptr& repo, const Repo::DocumenttypesConfig&) override { return PersistenceProvider::UP(new dummy::DummyPersistence(repo, 4)); } diff --git a/persistence/src/tests/dummyimpl/dummypersistence_test.cpp b/persistence/src/tests/dummyimpl/dummypersistence_test.cpp index c9e6b44508e..637b9ef512a 100644 --- a/persistence/src/tests/dummyimpl/dummypersistence_test.cpp +++ b/persistence/src/tests/dummyimpl/dummypersistence_test.cpp @@ -79,7 +79,7 @@ TEST_F("require that setClusterState sets the cluster state", Fixture) { lib::Distribution d(lib::Distribution::getDefaultDistributionConfig(3, 3)); ClusterState state(s, 1, d); - document::DocumentTypeRepo::SP repo; + std::shared_ptr repo; dummy::DummyPersistence provider(repo); provider.setClusterState(makeBucketSpace(), state); diff --git a/persistence/src/vespa/persistence/conformancetest/conformancetest.h b/persistence/src/vespa/persistence/conformancetest/conformancetest.h index 66b1dec113a..bf63508693f 100644 --- a/persistence/src/vespa/persistence/conformancetest/conformancetest.h +++ b/persistence/src/vespa/persistence/conformancetest/conformancetest.h @@ -77,7 +77,7 @@ struct ConformanceTest : public CppUnit::TestFixture { virtual ~PersistenceFactory() {} virtual PersistenceProvider::UP getPersistenceImplementation( - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const document::DocumentTypeRepo::DocumenttypesConfig &typesCfg) = 0; virtual void diff --git a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp index 84adaa574ec..0ce3cbe8b3d 100644 --- a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp +++ b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp @@ -294,7 +294,7 @@ BucketContent::eraseEntry(Timestamp t) } DummyPersistence::DummyPersistence( - const document::DocumentTypeRepo::SP& repo, + const std::shared_ptr& repo, uint16_t partitionCount) : _initialized(false), _repo(repo), diff --git a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h index f89afbcac5d..deb0ece98bd 100644 --- a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h +++ b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.h @@ -127,7 +127,7 @@ private: class DummyPersistence : public AbstractPersistenceProvider { public: - DummyPersistence(const document::DocumentTypeRepo::SP& repo, + DummyPersistence(const std::shared_ptr& repo, uint16_t partitionCount = 1); ~DummyPersistence(); @@ -211,7 +211,7 @@ private: void releaseBucketNoLock(const BucketContent& bc) const; mutable bool _initialized; - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; PartitionStateList _partitions; typedef vespalib::hash_map PartitionContent; diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index 3840cfb7869..ea18f513535 100644 --- a/searchcore/src/apps/tests/persistenceconformance_test.cpp +++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp @@ -88,16 +88,16 @@ struct SchemaConfigFactory { class ConfigFactory { private: - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; DocumenttypesConfigSP _typeCfg; SchemaConfigFactory::SP _schemaFactory; public: - ConfigFactory(const DocumentTypeRepo::SP &repo, + ConfigFactory(const std::shared_ptr &repo, const DocumenttypesConfigSP &typeCfg, const SchemaConfigFactory::SP &schemaFactory); ~ConfigFactory(); - const DocumentTypeRepo::SP getTypeRepo() const { return _repo; } + const std::shared_ptr getTypeRepo() const { return _repo; } const DocumenttypesConfigSP getTypeCfg() const { return _typeCfg; } DocTypeVector getDocTypes() const { DocTypeVector types; @@ -140,7 +140,7 @@ public: }; -ConfigFactory::ConfigFactory(const DocumentTypeRepo::SP &repo, const DocumenttypesConfigSP &typeCfg, +ConfigFactory::ConfigFactory(const std::shared_ptr &repo, const DocumenttypesConfigSP &typeCfg, const SchemaConfigFactory::SP &schemaFactory) : _repo(repo), _typeCfg(typeCfg), @@ -373,7 +373,7 @@ public: _writeFilter() { } - virtual PersistenceProvider::UP getPersistenceImplementation(const DocumentTypeRepo::SP &repo, + virtual PersistenceProvider::UP getPersistenceImplementation(const std::shared_ptr &repo, const DocumenttypesConfig &typesCfg) override { ConfigFactory cfgFactory(repo, DocumenttypesConfigSP(new DocumenttypesConfig(typesCfg)), _schemaFactory); _docDbRepo.reset(new DocumentDBRepo(cfgFactory, _docDbFactory)); diff --git a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp index 4d6d63cf641..e63f8e1a57a 100644 --- a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp +++ b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp @@ -57,7 +57,7 @@ private: virtual void handleMessage(mbus::Message::UP message) override; public: - FeedHandler(document::DocumentTypeRepo::SP repo, OutputFile &idx, OutputFile &dat); + FeedHandler(std::shared_ptr repo, OutputFile &idx, OutputFile &dat); std::string getRoute() { return _session->getConnectionSpec(); } virtual ~FeedHandler(); }; @@ -93,7 +93,7 @@ FeedHandler::handleMessage(mbus::Message::UP message) _session->reply(std::move(reply)); // handle all messages synchronously } -FeedHandler::FeedHandler(document::DocumentTypeRepo::SP repo, OutputFile &idx, OutputFile &dat) +FeedHandler::FeedHandler(std::shared_ptr repo, OutputFile &idx, OutputFile &dat) : _loadTypes(), _mbus(mbus::MessageBusParams().addProtocol(mbus::IProtocol::SP(new documentapi::DocumentProtocol(_loadTypes, repo))), mbus::RPCNetworkParams()), @@ -147,10 +147,10 @@ std::unique_ptr getConfig() { return ret; } -document::DocumentTypeRepo::SP getRepo() { +std::shared_ptr getRepo() { typedef document::DocumenttypesConfig DCFG; std::unique_ptr dcfg = getConfig(); - document::DocumentTypeRepo::SP ret; + std::shared_ptr ret; if (dcfg.get() != 0) { ret.reset(new document::DocumentTypeRepo(*dcfg)); } @@ -187,7 +187,7 @@ App::Main() fprintf(stderr, "error: could not save config to disk\n"); return 1; } - document::DocumentTypeRepo::SP repo = getRepo(); + std::shared_ptr repo = getRepo(); if (repo.get() == 0) { fprintf(stderr, "error: could not create document type repo\n"); return 1; diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index 0338bb5506a..e6abb4f6c51 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -84,7 +84,7 @@ class BuildContext public: DirMaker _dmk; DocBuilder _bld; - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; DummyFileHeaderContext _fileHeaderContext; vespalib::ThreadStackExecutor _summaryExecutor; search::transactionlog::NoSyncProxy _noTlSyncer; @@ -178,14 +178,14 @@ public: config::DirSpec _spec; DocumentDBConfigHelper _configMgr; DocumentDBConfig::DocumenttypesConfigSP _documenttypesConfig; - const DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; TuneFileDocumentDB::SP _tuneFileDocumentDB; HwInfo _hwInfo; std::unique_ptr _ddb; AttributeWriter::UP _aw; ISummaryAdapter::SP _sa; - DBContext(const DocumentTypeRepo::SP &repo, const char *docTypeName) + DBContext(const std::shared_ptr &repo, const char *docTypeName) : _dmk(docTypeName), _fileHeaderContext(), _tls("tmp", 9013, ".", _fileHeaderContext), diff --git a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp index 2d0ff39efa4..7f8ce99beb9 100644 --- a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp +++ b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp @@ -135,7 +135,7 @@ FieldBlock::~FieldBlock() {} class Test : public vespalib::TestApp { std::unique_ptr _schema; std::unique_ptr _summarymap; - DocumentTypeRepo::SP _documentRepo; + std::shared_ptr _documentRepo; const DocumentType *_documentType; document::FixedTypeRepo _fixedRepo; diff --git a/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp index c7006be2804..cc94441ccf6 100644 --- a/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/combiningfeedview/combiningfeedview_test.cpp @@ -44,7 +44,7 @@ struct MyFeedView : public test::DummyFeedView uint32_t _heartBeat; uint32_t _handlePrune; uint32_t _wantedLidLimit; - MyFeedView(const DocumentTypeRepo::SP &repo, + MyFeedView(const std::shared_ptr &repo, std::shared_ptr bucketDB, SubDbType subDbType) : test::DummyFeedView(repo), @@ -94,7 +94,7 @@ struct MyFeedView : public test::DummyFeedView struct MySubDb { MyFeedView::SP _view; - MySubDb(const DocumentTypeRepo::SP &repo, + MySubDb(const std::shared_ptr &repo, std::shared_ptr bucketDB, SubDbType subDbType) : _view(new MyFeedView(repo, bucketDB, subDbType)) diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index d3567da3527..60cbfeb29b9 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -67,11 +67,11 @@ class IndexManagerDummyReconfigurer : public searchcorespi::IIndexManager::Recon } }; -DocumentTypeRepo::SP +std::shared_ptr createRepo() { DocumentType docType(DOC_TYPE, 0); - return DocumentTypeRepo::SP(new DocumentTypeRepo(docType)); + return std::shared_ptr(new DocumentTypeRepo(docType)); } struct ViewPtrs @@ -89,7 +89,7 @@ struct ViewSet DummyFileHeaderContext _fileHeaderContext; ExecutorThreadingService _writeService; SearchableFeedView::SerialNum serialNum; - DocumentTypeRepo::SP repo; + std::shared_ptr repo; DocTypeName _docTypeName; DocIdLimit _docIdLimit; search::transactionlog::NoSyncProxy _noTlSyncer; @@ -267,7 +267,7 @@ struct MyFastAccessFeedView Schema::SP schema(new Schema()); _dmsc = make_shared(std::make_shared()); _lidReuseDelayer.reset(new documentmetastore::LidReuseDelayer(_writeService, _dmsc->get())); - DocumentTypeRepo::SP repo = createRepo(); + std::shared_ptr repo = createRepo(); StoreOnlyFeedView::Context storeOnlyCtx(summaryAdapter, schema, _dmsc, *_gidToLidChangeHandler, repo, _writeService, *_lidReuseDelayer, _commitTimeTracker); StoreOnlyFeedView::PersistentParams params(1, 1, DocTypeName(DOC_TYPE), 0, SubDbType::NOTREADY); diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp index 7aa452c5aa3..11e9aa8c3ec 100644 --- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentbucketmover_test.cpp @@ -93,9 +93,9 @@ struct MyMoveHandler : public IDocumentMoveHandler struct MyDocumentRetriever : public DocumentRetrieverBaseForTest { - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; DocumentVector _docs; - MyDocumentRetriever(DocumentTypeRepo::SP repo) : _repo(repo), _docs() { + MyDocumentRetriever(std::shared_ptr repo) : _repo(repo), _docs() { _docs.push_back(Document::SP()); // lid 0 invalid } virtual const document::DocumentTypeRepo &getDocumentTypeRepo() const override { return *_repo; } @@ -133,7 +133,7 @@ struct MySubDb MaintenanceDocumentSubDB _subDb; test::UserDocuments _docs; bucketdb::BucketDBHandler _bucketDBHandler; - MySubDb(const DocumentTypeRepo::SP &repo, std::shared_ptr bucketDB, + MySubDb(const std::shared_ptr &repo, std::shared_ptr bucketDB, uint32_t subDbId, SubDbType subDbType); ~MySubDb(); void insertDocs(const test::UserDocuments &docs_) { @@ -178,7 +178,7 @@ struct MySubDb }; -MySubDb::MySubDb(const DocumentTypeRepo::SP &repo, std::shared_ptr bucketDB, +MySubDb::MySubDb(const std::shared_ptr &repo, std::shared_ptr bucketDB, uint32_t subDbId, SubDbType subDbType) : _metaStoreSP(std::make_shared(bucketDB, DocumentMetaStore::getFixedName(), diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index 9f6eb0ea4e1..14a0dc89b65 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -90,7 +90,7 @@ Fixture::Fixture() { DocumentDBConfig::DocumenttypesConfigSP documenttypesConfig(new DocumenttypesConfig()); DocumentType docType("typea", 0); - DocumentTypeRepo::SP repo(new DocumentTypeRepo(docType)); + std::shared_ptr repo(new DocumentTypeRepo(docType)); TuneFileDocumentDB::SP tuneFileDocumentDB(new TuneFileDocumentDB); config::DirSpec spec(TEST_PATH("cfg")); DocumentDBConfigHelper mgr(spec, "typea"); diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp index 17353f89fd2..df01ae0fc02 100644 --- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp @@ -30,7 +30,7 @@ const vespalib::string type_name = "test"; const vespalib::string header_name = type_name + ".header"; const vespalib::string body_name = type_name + ".body"; -DocumentTypeRepo::SP +std::shared_ptr makeDocTypeRepo(bool hasField) { DocumenttypesConfigBuilderHelper builder; @@ -49,7 +49,7 @@ private: test::DocumentDBConfigBuilder _builder; public: - MyConfigBuilder(int64_t generation, const Schema::SP &schema, const DocumentTypeRepo::SP &repo) + MyConfigBuilder(int64_t generation, const Schema::SP &schema, const std::shared_ptr &repo) : _builder(generation, schema, "client", "test") { _builder.repo(repo); @@ -101,7 +101,7 @@ public: struct Fixture { Schema::SP schema; - DocumentTypeRepo::SP repo; + std::shared_ptr repo; ConfigSP basicCfg; ConfigSP fullCfg; ConfigSP replayCfg; diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp index b8ffc41d3cd..10718508d33 100644 --- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp @@ -179,7 +179,7 @@ struct MyFeedView : public test::DummyFeedView { int prune_removed_count; int update_count; SerialNum update_serial; - MyFeedView(const DocumentTypeRepo::SP &dtr); + MyFeedView(const std::shared_ptr &dtr); ~MyFeedView() override; void resetPutLatch(uint32_t count) { putLatch.reset(new vespalib::CountDownLatch(count)); } void preparePut(PutOperation &op) override { @@ -229,7 +229,7 @@ struct MyFeedView : public test::DummyFeedView { } }; -MyFeedView::MyFeedView(const DocumentTypeRepo::SP &dtr) +MyFeedView::MyFeedView(const std::shared_ptr &dtr) : test::DummyFeedView(dtr), putRdz(), usePutRdz(false), @@ -260,7 +260,7 @@ struct SchemaContext { DocTypeName getDocType() const { return DocTypeName(builder->getDocumentType().getName()); } - const document::DocumentTypeRepo::SP &getRepo() const { return builder->getDocumentTypeRepo(); } + const std::shared_ptr &getRepo() const { return builder->getDocumentTypeRepo(); } }; diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp index 54aefef4463..00eb59f120a 100644 --- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp @@ -432,7 +432,7 @@ struct SchemaContext std::unique_ptr _builder; SchemaContext(); ~SchemaContext(); - const document::DocumentTypeRepo::SP &getRepo() const { return _builder->getDocumentTypeRepo(); } + const std::shared_ptr &getRepo() const { return _builder->getDocumentTypeRepo(); } }; SchemaContext::SchemaContext() : diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp index dd35d823b99..a04e340c96f 100644 --- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp +++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp @@ -41,7 +41,7 @@ makeBaseConfigSnapshot() DBCM dbcm(spec, "test"); DocumenttypesConfigSP dtcfg(config::ConfigGetter::getConfig("", spec).release()); BootstrapConfig::SP b(new BootstrapConfig(1, dtcfg, - DocumentTypeRepo::SP(new DocumentTypeRepo(*dtcfg)), + std::shared_ptr(new DocumentTypeRepo(*dtcfg)), std::make_shared(), std::make_shared(), std::make_shared(), diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp index 56bd99c90f6..82566025a30 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp @@ -162,7 +162,7 @@ struct MyFrozenBucketHandler : public IFrozenBucketHandler struct MyFeedView : public test::DummyFeedView { - MyFeedView(const DocumentTypeRepo::SP &repo) + MyFeedView(const std::shared_ptr &repo) : test::DummyFeedView(repo) { } @@ -189,8 +189,8 @@ struct MySummaryManager : public test::DummySummaryManager struct MySubDb : public test::DummyDocumentSubDb { - DocumentTypeRepo::SP _repo; - MySubDb(const DocumentTypeRepo::SP &repo, std::shared_ptr bucketDB); + std::shared_ptr _repo; + MySubDb(const std::shared_ptr &repo, std::shared_ptr bucketDB); ~MySubDb(); virtual IFeedView::SP getFeedView() const override { return IFeedView::SP(new MyFeedView(_repo)); @@ -198,7 +198,7 @@ struct MySubDb : public test::DummyDocumentSubDb }; -MySubDb::MySubDb(const DocumentTypeRepo::SP &repo, std::shared_ptr bucketDB) +MySubDb::MySubDb(const std::shared_ptr &repo, std::shared_ptr bucketDB) : test::DummyDocumentSubDb(bucketDB, SUBDB_ID), _repo(repo) { diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp index bf88a0c3003..9810b7243a5 100644 --- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp +++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp @@ -87,11 +87,11 @@ class MyDocumentSubDB uint32_t _subDBId; DocumentMetaStore::SP _metaStoreSP; DocumentMetaStore & _metaStore; - const document::DocumentTypeRepo::SP &_repo; + const std::shared_ptr &_repo; const DocTypeName &_docTypeName; public: - MyDocumentSubDB(uint32_t subDBId, SubDbType subDbType, const document::DocumentTypeRepo::SP &repo, + MyDocumentSubDB(uint32_t subDBId, SubDbType subDbType, const std::shared_ptr &repo, std::shared_ptr bucketDB, const DocTypeName &docTypeName); ~MyDocumentSubDB(); @@ -124,7 +124,7 @@ public: const IDocumentMetaStore &getMetaStore() const { return _metaStore; } }; -MyDocumentSubDB::MyDocumentSubDB(uint32_t subDBId, SubDbType subDbType, const document::DocumentTypeRepo::SP &repo, +MyDocumentSubDB::MyDocumentSubDB(uint32_t subDBId, SubDbType subDbType, const std::shared_ptr &repo, std::shared_ptr bucketDB, const DocTypeName &docTypeName) : _docs(), _subDBId(subDBId), diff --git a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp index bbdabe2d0ef..e8247a52199 100644 --- a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp @@ -55,10 +55,10 @@ public: void heartBeat(SerialNum) override { ++_heartbeatCount; } }; -DocumentTypeRepo::SP myGetDocumentTypeRepo() { +std::shared_ptr myGetDocumentTypeRepo() { Schema schema; DocBuilder builder(schema); - DocumentTypeRepo::SP repo = builder.getDocumentTypeRepo(); + std::shared_ptr repo = builder.getDocumentTypeRepo(); ASSERT_TRUE(repo.get()); return repo; } diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp index 896a9debef3..a43bbd050db 100644 --- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp +++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp @@ -112,7 +112,7 @@ makeDocTypeRepo() struct Fixture { - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; const DocumentType &_docType; public: 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 d59a67d73bb..9de850b37ec 100644 --- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp +++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp @@ -70,7 +70,7 @@ struct DBConfigFixture { DocumentDBConfig::SP getConfig(int64_t generation, std::shared_ptr documentTypes, - DocumentTypeRepo::SP repo, + std::shared_ptr repo, const vespalib::string &configId, const vespalib::string &docTypeName) { @@ -167,7 +167,7 @@ struct ConfigFixture { BootstrapConfig::SP getBootstrapConfig(int64_t generation) const { return BootstrapConfig::SP(new BootstrapConfig(generation, BootstrapConfig::DocumenttypesConfigSP(new DocumenttypesConfig(_documenttypesBuilder)), - DocumentTypeRepo::SP(new DocumentTypeRepo(_documenttypesBuilder)), + std::shared_ptr(new DocumentTypeRepo(_documenttypesBuilder)), BootstrapConfig::ProtonConfigSP(new ProtonConfig(_protonBuilder)), std::make_shared(), std::make_shared(_bucketspacesBuilder), diff --git a/searchcore/src/tests/proton/server/feedstates_test.cpp b/searchcore/src/tests/proton/server/feedstates_test.cpp index a6f3496e1ed..edb581347c6 100644 --- a/searchcore/src/tests/proton/server/feedstates_test.cpp +++ b/searchcore/src/tests/proton/server/feedstates_test.cpp @@ -34,13 +34,13 @@ namespace { struct MyFeedView : public test::DummyFeedView { TestDocRepo repo; - DocumentTypeRepo::SP repo_sp; + std::shared_ptr repo_sp; int remove_handled; MyFeedView(); ~MyFeedView(); - const DocumentTypeRepo::SP &getDocumentTypeRepo() const override { return repo_sp; } + const std::shared_ptr &getDocumentTypeRepo() const override { return repo_sp; } void handleRemove(FeedToken , const RemoveOperation &) override { ++remove_handled; } }; diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h b/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h index 3426c689122..4f3e7bf538b 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/isummarymanager.h @@ -51,7 +51,7 @@ public: createSummarySetup(const vespa::config::search::SummaryConfig &summaryCfg, const vespa::config::search::SummarymapConfig &summarymapCfg, const vespa::config::search::summary::JuniperrcConfig &juniperCfg, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const std::shared_ptr &attributeMgr) = 0; virtual search::IDocumentStore &getBackingStore() = 0; diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp index a8ec474e88c..6636552b695 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp @@ -81,7 +81,7 @@ SummaryManager::SummarySetup:: SummarySetup(const vespalib::string & baseDir, const DocTypeName & docTypeName, const SummaryConfig & summaryCfg, const SummarymapConfig & summarymapCfg, const JuniperrcConfig & juniperCfg, const search::IAttributeManager::SP &attributeMgr, const search::IDocumentStore::SP & docStore, - const DocumentTypeRepo::SP &repo) + const std::shared_ptr &repo) : _docsumWriter(), _wordFolder(), _juniperProps(juniperCfg), @@ -138,7 +138,7 @@ SummaryManager::SummarySetup::createDocsumStore(const vespalib::string &resultCl ISummaryManager::ISummarySetup::SP SummaryManager::createSummarySetup(const SummaryConfig & summaryCfg, const SummarymapConfig & summarymapCfg, - const JuniperrcConfig & juniperCfg, const DocumentTypeRepo::SP &repo, + const JuniperrcConfig & juniperCfg, const std::shared_ptr &repo, const search::IAttributeManager::SP &attributeMgr) { return std::make_shared(_baseDir, _docTypeName, summaryCfg, summarymapCfg, diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h index 826c39046a4..f6bd8cced6f 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h @@ -32,7 +32,7 @@ public: search::IAttributeManager::SP _attributeMgr; search::IDocumentStore::SP _docStore; FieldCacheRepo::UP _fieldCacheRepo; - const document::DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; std::set _markupFields; public: SummarySetup(const vespalib::string & baseDir, @@ -42,7 +42,7 @@ public: const vespa::config::search::summary::JuniperrcConfig & juniperCfg, const search::IAttributeManager::SP &attributeMgr, const search::IDocumentStore::SP & docStore, - const document::DocumentTypeRepo::SP &repo); + const std::shared_ptr &repo); search::docsummary::IDocsumWriter & getDocsumWriter() const override { return *_docsumWriter; } search::docsummary::ResultConfig & getResultConfig() override { return *_docsumWriter->GetResultConfig(); } @@ -83,7 +83,7 @@ public: createSummarySetup(const vespa::config::search::SummaryConfig &summaryCfg, const vespa::config::search::SummarymapConfig &summarymapCfg, const vespa::config::search::summary::JuniperrcConfig &juniperCfg, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const search::IAttributeManager::SP &attributeMgr) override; search::IDocumentStore & getBackingStore() override { return *_docStore; } diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.cpp b/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.cpp index 0b0b16653e2..f3b41c745b6 100644 --- a/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.cpp +++ b/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.cpp @@ -10,7 +10,7 @@ namespace proton { ReprocessDocumentsTask:: ReprocessDocumentsTask(IReprocessingInitializer &initializer, const proton::ISummaryManager::SP &sm, - const document::DocumentTypeRepo::SP &docTypeRepo, + const std::shared_ptr &docTypeRepo, const vespalib::string &subDbName, uint32_t docIdLimit) : _sm(sm), diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.h b/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.h index 622117149f5..8d0f54965a8 100644 --- a/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.h +++ b/searchcore/src/vespa/searchcore/proton/reprocessing/reprocess_documents_task.h @@ -21,7 +21,7 @@ class ReprocessDocumentsTask : public IReprocessingTask, public search::IDocumentStoreVisitorProgress { proton::ISummaryManager::SP _sm; - document::DocumentTypeRepo::SP _docTypeRepo; + std::shared_ptr _docTypeRepo; vespalib::string _subDbName; double _visitorProgress; double _visitorCost; @@ -33,7 +33,7 @@ class ReprocessDocumentsTask : public IReprocessingTask, public: ReprocessDocumentsTask(IReprocessingInitializer &initializer, const proton::ISummaryManager::SP &sm, - const document::DocumentTypeRepo::SP &docTypeRepo, + const std::shared_ptr &docTypeRepo, const vespalib::string &subDbName, uint32_t docIdLimit); diff --git a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.cpp index 1bc5cf00ad0..68abbe87c21 100644 --- a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.cpp @@ -25,7 +25,7 @@ namespace proton { BootstrapConfig::BootstrapConfig( int64_t generation, const DocumenttypesConfigSP &documenttypes, - const DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const ProtonConfigSP &protonConfig, const FiledistributorrpcConfigSP &filedistRpcConfSP, const BucketspacesConfigSP &bucketspaces, diff --git a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.h b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.h index 368cc30d8a4..bdad8c31337 100644 --- a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.h +++ b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfig.h @@ -32,7 +32,7 @@ public: private: DocumenttypesConfigSP _documenttypes; - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; ProtonConfigSP _proton; FiledistributorrpcConfigSP _fileDistributorRpc; BucketspacesConfigSP _bucketspaces; @@ -43,7 +43,7 @@ private: public: BootstrapConfig(int64_t generation, const DocumenttypesConfigSP & documenttypes, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const ProtonConfigSP &protonConfig, const FiledistributorrpcConfigSP &filedistRpcConfSP, const BucketspacesConfigSP &bucketspaces, @@ -55,7 +55,7 @@ public: const FiledistributorrpcConfig &getFiledistributorrpcConfig() const { return *_fileDistributorRpc; } const FiledistributorrpcConfigSP &getFiledistributorrpcConfigSP() const { return _fileDistributorRpc; } const DocumenttypesConfigSP &getDocumenttypesConfigSP() const { return _documenttypes; } - const document::DocumentTypeRepo::SP &getDocumentTypeRepoSP() const { return _repo; } + const std::shared_ptr &getDocumentTypeRepoSP() const { return _repo; } const vespa::config::search::core::ProtonConfig &getProtonConfig() const { return *_proton; } const ProtonConfigSP &getProtonConfigSP() const { return _proton; } const BucketspacesConfigSP &getBucketspacesConfigSP() const { return _bucketspaces; } diff --git a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp index c3310dd193b..9f0d694aa57 100644 --- a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp @@ -58,7 +58,7 @@ BootstrapConfigManager::update(const ConfigSnapshot & snapshot) BootstrapConfig::FiledistributorrpcConfigSP newFiledistRpcConfSP; TuneFileDocumentDB::SP newTuneFileDocumentDB; DocumenttypesConfigSP newDocumenttypesConfig; - DocumentTypeRepo::SP newRepo; + std::shared_ptr newRepo; BucketspacesConfigSP newBucketspacesConfig; int64_t currentGen = -1; diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp index 106ce846d99..71b6fe73e38 100644 --- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp @@ -19,7 +19,7 @@ namespace proton namespace { -DocumentTypeRepo::SP +std::shared_ptr getRepo(const std::vector &views) { for (const auto &view : views) { @@ -28,7 +28,7 @@ getRepo(const std::vector &views) return view->getDocumentTypeRepo(); } abort(); - return DocumentTypeRepo::SP(); + return std::shared_ptr(); } }; @@ -92,7 +92,7 @@ CombiningFeedView::findPrevDbdId(const document::GlobalId &gid, } } -const DocumentTypeRepo::SP & +const std::shared_ptr & CombiningFeedView::getDocumentTypeRepo() const { return _repo; diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h index 284004dfa81..6644f21a3b7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h +++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h @@ -22,7 +22,7 @@ namespace proton { class CombiningFeedView : public IFeedView { private: - const document::DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; std::vector _views; std::vector _metaStores; IBucketStateCalculator::SP _calc; @@ -64,7 +64,7 @@ public: ~CombiningFeedView() override; - const document::DocumentTypeRepo::SP & getDocumentTypeRepo() const override; + const std::shared_ptr & getDocumentTypeRepo() const override; /** * Similar to IPersistenceHandler functions. diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp index db73e9f38b8..c3bc7fbed45 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp @@ -56,7 +56,7 @@ DocumentDBConfig::DocumentDBConfig( const SummarymapConfigSP &summarymap, const JuniperrcConfigSP &juniperrc, const DocumenttypesConfigSP &documenttypes, - const DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const ImportedFieldsConfigSP &importedFields, const search::TuneFileDocumentDB::SP &tuneFileDocumentDB, const Schema::SP &schema, diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h index df023028123..e5010d7a782 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h @@ -112,7 +112,7 @@ private: SummarymapConfigSP _summarymap; JuniperrcConfigSP _juniperrc; DocumenttypesConfigSP _documenttypes; - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; ImportedFieldsConfigSP _importedFields; search::TuneFileDocumentDB::SP _tuneFileDocumentDB; search::index::Schema::SP _schema; @@ -148,7 +148,7 @@ public: const SummarymapConfigSP &summarymap, const JuniperrcConfigSP &juniperrc, const DocumenttypesConfigSP &documenttypesConfig, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const ImportedFieldsConfigSP &importedFields, const search::TuneFileDocumentDB::SP &tuneFileDocumentDB, const search::index::Schema::SP &schema, @@ -183,7 +183,7 @@ public: const SummarymapConfigSP &getSummarymapConfigSP() const { return _summarymap; } const JuniperrcConfigSP &getJuniperrcConfigSP() const { return _juniperrc; } const DocumenttypesConfigSP &getDocumenttypesConfigSP() const { return _documenttypes; } - const document::DocumentTypeRepo::SP &getDocumentTypeRepoSP() const { return _repo; } + const std::shared_ptr &getDocumentTypeRepoSP() const { return _repo; } const document::DocumentType *getDocumentType() const { return _repo->getDocumentType(getDocTypeName()); } const ImportedFieldsConfig &getImportedFieldsConfig() const { return *_importedFields; } const ImportedFieldsConfigSP &getImportedFieldsConfigSP() const { return _importedFields; } 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 2a3bc600a8f..acb097c16aa 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 @@ -187,7 +187,7 @@ FastAccessDocSubDB::reconfigureAttributeMetrics(const proton::IAttributeManager IReprocessingTask::UP FastAccessDocSubDB::createReprocessingTask(IReprocessingInitializer &initializer, - const document::DocumentTypeRepo::SP &docTypeRepo) const + const std::shared_ptr &docTypeRepo) const { uint32_t docIdLimit = _metaStoreCtx->get().getCommittedDocIdLimit(); assert(docIdLimit > 0); 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 32c006fd8b7..de2d82aed39 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 @@ -94,7 +94,7 @@ protected: void reconfigureAttributeMetrics(const IAttributeManager &newMgr, const IAttributeManager &oldMgr); IReprocessingTask::UP createReprocessingTask(IReprocessingInitializer &initializer, - const document::DocumentTypeRepo::SP &docTypeRepo) const; + const std::shared_ptr &docTypeRepo) const; public: FastAccessDocSubDB(const Config &cfg, const Context &ctx); diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.cpp index 2b9a37fac0b..36d5ec31a71 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.cpp @@ -17,7 +17,7 @@ using ARIConfig = AttributeReprocessingInitializer::Config; void FastAccessDocSubDBConfigurer::reconfigureFeedView(const FastAccessFeedView::SP &curr, const Schema::SP &schema, - const DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const IAttributeWriter::SP &writer) { _feedView.set(FastAccessFeedView::SP(new FastAccessFeedView( diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h index 350992702a2..e1744ff2d28 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h +++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h @@ -24,7 +24,7 @@ private: void reconfigureFeedView(const FastAccessFeedView::SP &curr, const search::index::Schema::SP &schema, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const IAttributeWriter::SP &attrWriter); public: diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp index 37a8ee2aadf..e017d9b81d4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp @@ -340,7 +340,7 @@ FileConfigManager::loadConfig(const DocumentDBConfig ¤tSnapshot, typedef DocumenttypesConfig DTC; typedef DocumentDBConfig::DocumenttypesConfigSP DTCSP; DTCSP docTypesCfg(config::ConfigGetter::getConfig("", spec).release()); - DocumentTypeRepo::SP repo; + std::shared_ptr repo; if (currentSnapshot.getDocumenttypesConfigSP() && currentSnapshot.getDocumentTypeRepoSP() && currentSnapshot.getDocumenttypesConfig() == *docTypesCfg) { diff --git a/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.cpp b/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.cpp index 473bba330ed..c2cf1f1e141 100644 --- a/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.cpp @@ -12,7 +12,7 @@ namespace proton { MinimalDocumentRetriever::MinimalDocumentRetriever( const DocTypeName &docTypeName, - const DocumentTypeRepo::SP repo, + const std::shared_ptr repo, const IDocumentMetaStoreContext &meta_store, const IDocumentStore &doc_store, bool hasFields) diff --git a/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.h b/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.h index c2866818fc6..c60372c6253 100644 --- a/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.h +++ b/searchcore/src/vespa/searchcore/proton/server/minimal_document_retriever.h @@ -16,13 +16,13 @@ namespace proton { */ class MinimalDocumentRetriever : public DocumentRetrieverBase { - const document::DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; const search::IDocumentStore &_doc_store; public: // meta_store and doc_store must out-live the MinimalDocumentRetriever. MinimalDocumentRetriever(const DocTypeName &docTypeName, - const document::DocumentTypeRepo::SP repo, + const std::shared_ptr repo, const IDocumentMetaStoreContext &meta_store, const search::IDocumentStore &doc_store, bool hasFields); diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index e8ded2eb4d6..3364b470ee0 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -335,7 +335,7 @@ Proton::applyConfig(const BootstrapConfig::SP & configSnapshot) _queryLimiter.configure(protonConfig.search.memory.limiter.maxthreads, protonConfig.search.memory.limiter.mincoverage, protonConfig.search.memory.limiter.minhits); - const DocumentTypeRepo::SP repo = configSnapshot->getDocumentTypeRepoSP(); + const std::shared_ptr repo = configSnapshot->getDocumentTypeRepoSP(); _diskMemUsageSampler->setConfig(diskMemUsageSamplerConfig(protonConfig, configSnapshot->getHwInfo())); if (_memoryFlushConfigUpdater) { @@ -353,7 +353,7 @@ Proton::addDocumentDB(const DocTypeName &docTypeName, InitializeThreads initializeThreads) { try { - const DocumentTypeRepo::SP repo = bootstrapConfig->getDocumentTypeRepoSP(); + const std::shared_ptr repo = bootstrapConfig->getDocumentTypeRepoSP(); const document::DocumentType *docType = repo->getDocumentType(docTypeName.getName()); if (docType != NULL) { LOG(info, "Add document database: doctypename(%s), configid(%s)", diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp index e7e6c213eb2..42dcd2f97d5 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp @@ -39,7 +39,7 @@ SearchableDocSubDBConfigurer::reconfigureFeedView(const IIndexWriter::SP &indexW const ISummaryAdapter::SP &summaryAdapter, const IAttributeWriter::SP &attrWriter, const Schema::SP &schema, - const DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const SearchView::SP &searchView) { SearchableFeedView::SP curr = _feedView.get(); diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h index 39be383dcd3..c793ba815d2 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h @@ -54,7 +54,7 @@ private: const ISummaryAdapter::SP &summaryAdapter, const IAttributeWriter::SP &attrWriter, const search::index::Schema::SP &schema, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, const SearchView::SP &searchView); void diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h index a8119224ba8..b106b87c4fe 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h @@ -74,7 +74,7 @@ public: const search::index::Schema::SP &_schema; const IDocumentMetaStoreContext::SP &_documentMetaStoreContext; IGidToLidChangeHandler &_gidToLidChangeHandler; - const document::DocumentTypeRepo::SP &_repo; + const std::shared_ptr &_repo; searchcorespi::index::IThreadingService &_writeService; documentmetastore::ILidReuseDelayer &_lidReuseDelayer; CommitTimeTracker &_commitTimeTracker; @@ -83,7 +83,7 @@ public: const search::index::Schema::SP &schema, const IDocumentMetaStoreContext::SP &documentMetaStoreContext, IGidToLidChangeHandler &gidToLidChangeHandler, - const document::DocumentTypeRepo::SP &repo, + const std::shared_ptr &repo, searchcorespi::index::IThreadingService &writeService, documentmetastore::ILidReuseDelayer &lidReuseDelayer, CommitTimeTracker &commitTimeTracker) @@ -137,7 +137,7 @@ protected: private: const ISummaryAdapter::SP _summaryAdapter; const IDocumentMetaStoreContext::SP _documentMetaStoreContext; - const document::DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; const document::DocumentType *_docType; documentmetastore::ILidReuseDelayer &_lidReuseDelayer; CommitTimeTracker &_commitTimeTracker; @@ -232,7 +232,7 @@ public: CommitTimeTracker &getCommitTimeTracker() { return _commitTimeTracker; } IGidToLidChangeHandler &getGidToLidChangeHandler() const { return _gidToLidChangeHandler; } - const document::DocumentTypeRepo::SP &getDocumentTypeRepo() const override { return _repo; } + const std::shared_ptr &getDocumentTypeRepo() const override { return _repo; } const ISimpleDocumentMetaStore *getDocumentMetaStorePtr() const override; void preparePut(PutOperation &putOp) override; diff --git a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h index 0dd812c354c..2de71dc3e1b 100644 --- a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h +++ b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.h @@ -20,7 +20,7 @@ private: DocumentDBConfig::SummarymapConfigSP _summarymap; DocumentDBConfig::JuniperrcConfigSP _juniperrc; DocumentDBConfig::DocumenttypesConfigSP _documenttypes; - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; DocumentDBConfig::ImportedFieldsConfigSP _importedFields; search::TuneFileDocumentDB::SP _tuneFileDocumentDB; search::index::Schema::SP _schema; @@ -38,7 +38,7 @@ public: DocumentDBConfigBuilder(const DocumentDBConfig &cfg); - DocumentDBConfigBuilder &repo(const document::DocumentTypeRepo::SP &repo_in) { + DocumentDBConfigBuilder &repo(const std::shared_ptr &repo_in) { _repo = repo_in; return *this; } diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h b/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h index 163168a1a09..fd15e09bcd0 100644 --- a/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h +++ b/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h @@ -8,15 +8,15 @@ namespace proton::test { struct DummyFeedView : public IFeedView { - document::DocumentTypeRepo::SP _docTypeRepo; + std::shared_ptr _docTypeRepo; DummyFeedView() : _docTypeRepo() {} - DummyFeedView(const document::DocumentTypeRepo::SP &docTypeRepo) + DummyFeedView(const std::shared_ptr &docTypeRepo) : _docTypeRepo(docTypeRepo) {} - const document::DocumentTypeRepo::SP &getDocumentTypeRepo() const override { + const std::shared_ptr &getDocumentTypeRepo() const override { return _docTypeRepo; } const ISimpleDocumentMetaStore *getDocumentMetaStorePtr() const override { diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h b/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h index bd5bfa39f74..6eed0e3fb86 100644 --- a/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h +++ b/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h @@ -13,7 +13,7 @@ struct DummySummaryManager : public ISummaryManager createSummarySetup(const vespa::config::search::SummaryConfig &, const vespa::config::search::SummarymapConfig &, const vespa::config::search::summary::JuniperrcConfig &, - const document::DocumentTypeRepo::SP &, + const std::shared_ptr &, const std::shared_ptr &) override { return ISummarySetup::SP(); } diff --git a/searchcore/src/vespa/searchcore/proton/test/userdocumentsbuilder.h b/searchcore/src/vespa/searchcore/proton/test/userdocumentsbuilder.h index 4ee4800d2e2..875ca04224b 100644 --- a/searchcore/src/vespa/searchcore/proton/test/userdocumentsbuilder.h +++ b/searchcore/src/vespa/searchcore/proton/test/userdocumentsbuilder.h @@ -19,7 +19,7 @@ private: public: UserDocumentsBuilder(); ~UserDocumentsBuilder(); - const document::DocumentTypeRepo::SP &getRepo() const { + const std::shared_ptr &getRepo() const { return _builder.getDocumentTypeRepo(); } UserDocumentsBuilder &createDoc(uint32_t userId, search::DocumentIdT lid); diff --git a/searchlib/src/vespa/searchlib/index/docbuilder.h b/searchlib/src/vespa/searchlib/index/docbuilder.h index c141917fbd3..f83f784a621 100644 --- a/searchlib/src/vespa/searchlib/index/docbuilder.h +++ b/searchlib/src/vespa/searchlib/index/docbuilder.h @@ -257,7 +257,7 @@ private: const Schema & _schema; document::DocumenttypesConfig _doctypes_config; - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; const document::DocumentType &_docType; document::Document::UP _doc; // the document we are about to generate @@ -302,7 +302,7 @@ public: static bool hasAnnotations() { return true; } const document::DocumentType &getDocumentType() const { return _docType; } - const document::DocumentTypeRepo::SP &getDocumentTypeRepo() const { return _repo; } + const std::shared_ptr &getDocumentTypeRepo() const { return _repo; } document::DocumenttypesConfig getDocumenttypesConfig() const { return _doctypes_config; } }; diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp index 8cc046861be..0c7122547db 100644 --- a/storage/src/tests/bucketdb/bucketmanagertest.cpp +++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp @@ -199,7 +199,7 @@ void BucketManagerTest::setupTestEnvironment(bool fakePersistenceLayer, assert(system(getMkDirDisk(rootFolder, 0).c_str()) == 0); assert(system(getMkDirDisk(rootFolder, 1).c_str()) == 0); - DocumentTypeRepo::SP repo(new DocumentTypeRepo( + std::shared_ptr repo(new DocumentTypeRepo( *ConfigGetter::getConfig( "config-doctypes", FileSpec(TEST_PATH("config-doctypes.cfg"))))); _top.reset(new DummyStorageLink); diff --git a/storage/src/tests/common/teststorageapp.cpp b/storage/src/tests/common/teststorageapp.cpp index 95237d1bfcb..8fd80d47bb3 100644 --- a/storage/src/tests/common/teststorageapp.cpp +++ b/storage/src/tests/common/teststorageapp.cpp @@ -90,7 +90,7 @@ TestStorageApp::setDistribution(Redundancy redundancy, NodeCount nodeCount) } void -TestStorageApp::setTypeRepo(document::DocumentTypeRepo::SP repo) +TestStorageApp::setTypeRepo(std::shared_ptr repo) { _compReg.setDocumentTypeRepo(repo); } diff --git a/storage/src/tests/common/teststorageapp.h b/storage/src/tests/common/teststorageapp.h index 369cdedc583..867ac9d38fc 100644 --- a/storage/src/tests/common/teststorageapp.h +++ b/storage/src/tests/common/teststorageapp.h @@ -68,14 +68,14 @@ public: // Set functions, to be able to modify content while running. void setDistribution(Redundancy, NodeCount); - void setTypeRepo(document::DocumentTypeRepo::SP repo); + void setTypeRepo(std::shared_ptr repo); void setClusterState(const lib::ClusterState&); // Utility functions for getting a hold of currently used bits. Practical // to avoid adding extra components in the tests. StorageComponentRegisterImpl& getComponentRegister() { return _compReg; } document::TestDocMan& getTestDocMan() { return _docMan; } - document::DocumentTypeRepo::SP getTypeRepo() + std::shared_ptr getTypeRepo() { return _compReg.getTypeRepo(); } const document::BucketIdFactory& getBucketIdFactory() { return _compReg.getBucketIdFactory(); } diff --git a/storage/src/tests/distributor/distributortestutil.cpp b/storage/src/tests/distributor/distributortestutil.cpp index 33167d61026..e43161946fb 100644 --- a/storage/src/tests/distributor/distributortestutil.cpp +++ b/storage/src/tests/distributor/distributortestutil.cpp @@ -83,7 +83,7 @@ DistributorTestUtil::triggerDistributionChange(lib::Distribution::SP distr) } void -DistributorTestUtil::setTypeRepo(const document::DocumentTypeRepo::SP &repo) +DistributorTestUtil::setTypeRepo(const std::shared_ptr &repo) { _node->getComponentRegister().setDocumentTypeRepo(repo); } diff --git a/storage/src/tests/distributor/distributortestutil.h b/storage/src/tests/distributor/distributortestutil.h index c2cb4fb2a62..69b5a5cdf6a 100644 --- a/storage/src/tests/distributor/distributortestutil.h +++ b/storage/src/tests/distributor/distributortestutil.h @@ -35,7 +35,7 @@ public: * Sets up the storage link chain. */ void createLinks(); - void setTypeRepo(const document::DocumentTypeRepo::SP &repo); + void setTypeRepo(const std::shared_ptr &repo); void close(); diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp index 80636bd33a7..064348539bf 100644 --- a/storage/src/tests/distributor/getoperationtest.cpp +++ b/storage/src/tests/distributor/getoperationtest.cpp @@ -43,7 +43,7 @@ class GetOperationTest : public CppUnit::TestFixture, public DistributorTestUtil CPPUNIT_TEST(canGetDocumentsWhenAllReplicaNodesRetired); CPPUNIT_TEST_SUITE_END(); - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; public: document::DocumentId docId; diff --git a/storage/src/tests/distributor/operationtargetresolvertest.cpp b/storage/src/tests/distributor/operationtargetresolvertest.cpp index fe5373a936f..17dbf007c63 100644 --- a/storage/src/tests/distributor/operationtargetresolvertest.cpp +++ b/storage/src/tests/distributor/operationtargetresolvertest.cpp @@ -27,7 +27,7 @@ struct OperationTargetResolverTest : public CppUnit::TestFixture, public DistributorTestUtil { - document::DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; const document::DocumentType* _html_type; std::unique_ptr op; diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp index 776e0275f68..b43d3cf64ad 100644 --- a/storage/src/tests/distributor/putoperationtest.cpp +++ b/storage/src/tests/distributor/putoperationtest.cpp @@ -59,7 +59,7 @@ class PutOperationTest : public CppUnit::TestFixture, CPPUNIT_TEST(replicaNotImplicitlyActivatedWhenActivationIsDisabled); CPPUNIT_TEST_SUITE_END(); - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; const DocumentType* _html_type; std::unique_ptr op; diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp index ed961b29b1c..29d50b1b9b7 100644 --- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp +++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp @@ -68,7 +68,7 @@ class TwoPhaseUpdateOperationTest : public CppUnit::TestFixture, CPPUNIT_TEST_SUITE_END(); document::TestDocRepo _testRepo; - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; const DocumentType* _doc_type; protected: diff --git a/storage/src/tests/distributor/updateoperationtest.cpp b/storage/src/tests/distributor/updateoperationtest.cpp index c15a2b4057c..ccbee0093ba 100644 --- a/storage/src/tests/distributor/updateoperationtest.cpp +++ b/storage/src/tests/distributor/updateoperationtest.cpp @@ -35,7 +35,7 @@ class UpdateOperation_Test : public CppUnit::TestFixture, CPPUNIT_TEST(testMultiNodeInconsistentTimestamp); CPPUNIT_TEST_SUITE_END(); - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; const DocumentType *_html_type; protected: diff --git a/storage/src/tests/persistence/persistencetestutils.h b/storage/src/tests/persistence/persistencetestutils.h index 36b1fef7285..22ab954cc6a 100644 --- a/storage/src/tests/persistence/persistencetestutils.h +++ b/storage/src/tests/persistence/persistencetestutils.h @@ -62,7 +62,7 @@ public: FileStorHandler& fsHandler() { return *_env->_handler; } FileStorMetrics& metrics() { return _env->_metrics; } MessageKeeper& messageKeeper() { return _env->_messageKeeper; } - document::DocumentTypeRepo::SP getTypeRepo() { return _env->_component.getTypeRepo(); } + std::shared_ptr getTypeRepo() { return _env->_component.getTypeRepo(); } StorageComponent& getComponent() { return _env->_component; } TestServiceLayerApp& getNode() { return _env->_node; } diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp index caf498cb272..1c38107cb06 100644 --- a/storage/src/tests/storageserver/documentapiconvertertest.cpp +++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp @@ -61,7 +61,7 @@ struct DocumentApiConverterTest : public CppUnit::TestFixture { std::shared_ptr _bucketResolver; std::unique_ptr _converter; - const DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; const DataType& _html_type; DocumentApiConverterTest() diff --git a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp index febba2cf16d..cf3eed09bf0 100644 --- a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp @@ -39,7 +39,7 @@ RemoveLocationOperation::getBucketId( DistributorComponent& manager, const api::RemoveLocationCommand& cmd, document::BucketId& bid) { - document::DocumentTypeRepo::SP repo = + std::shared_ptr repo = manager.getTypeRepo(); document::select::Parser parser( *repo, manager.getBucketIdFactory()); diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp index 62598bce402..0a172ccd4e2 100644 --- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp +++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp @@ -77,7 +77,7 @@ StorageComponentRegisterImpl::setNodeStateUpdater(NodeStateUpdater& updater) } void -StorageComponentRegisterImpl::setDocumentTypeRepo(document::DocumentTypeRepo::SP repo) +StorageComponentRegisterImpl::setDocumentTypeRepo(std::shared_ptr repo) { vespalib::LockGuard lock(_componentLock); _docTypeRepo = repo; diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h index ffa91afd931..a3b6b58e806 100644 --- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h +++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h @@ -30,7 +30,7 @@ class StorageComponentRegisterImpl vespalib::string _clusterName; const lib::NodeType* _nodeType; uint16_t _index; - document::DocumentTypeRepo::SP _docTypeRepo; + std::shared_ptr _docTypeRepo; documentapi::LoadTypeSet::SP _loadTypes; PriorityConfig _priorityConfig; document::BucketIdFactory _bucketIdFactory; @@ -49,7 +49,7 @@ public: const lib::NodeType& getNodeType() const { assert(_nodeType != 0); return *_nodeType; } uint16_t getIndex() const { return _index; } - document::DocumentTypeRepo::SP getTypeRepo() { return _docTypeRepo; } + std::shared_ptr getTypeRepo() { return _docTypeRepo; } documentapi::LoadTypeSet::SP getLoadTypes() { return _loadTypes; } const document::BucketIdFactory& getBucketIdFactory() { return _bucketIdFactory; } lib::Distribution::SP getDistribution() { return _distribution; } @@ -62,7 +62,7 @@ public: const lib::NodeType& nodeType, uint16_t index); virtual void setNodeStateUpdater(NodeStateUpdater& updater); - virtual void setDocumentTypeRepo(document::DocumentTypeRepo::SP); + virtual void setDocumentTypeRepo(std::shared_ptr); virtual void setLoadTypes(documentapi::LoadTypeSet::SP); virtual void setPriorityConfig(const PriorityConfig&); virtual void setBucketIdFactory(const document::BucketIdFactory&); diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.cpp b/storage/src/vespa/storage/storageserver/communicationmanager.cpp index 105f1c25cca..4a50c015526 100644 --- a/storage/src/vespa/storage/storageserver/communicationmanager.cpp +++ b/storage/src/vespa/storage/storageserver/communicationmanager.cpp @@ -767,7 +767,7 @@ CommunicationManager::print(std::ostream& out, bool verbose, const std::string& } void CommunicationManager::updateMessagebusProtocol( - const document::DocumentTypeRepo::SP &repo) { + const std::shared_ptr &repo) { if (_mbus.get()) { framework::SecondTime now(_component.getClock().getTimeInSeconds()); auto newDocumentProtocol = std::make_shared(*_component.getLoadTypes(), repo); diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.h b/storage/src/vespa/storage/storageserver/communicationmanager.h index 5c7d5812fdb..1e777258bbb 100644 --- a/storage/src/vespa/storage/storageserver/communicationmanager.h +++ b/storage/src/vespa/storage/storageserver/communicationmanager.h @@ -176,7 +176,7 @@ public: std::unique_ptr mbusMsg, const mbus::Route& route); void handleReply(std::unique_ptr msg) override; - void updateMessagebusProtocol(const document::DocumentTypeRepo::SP &repo); + void updateMessagebusProtocol(const std::shared_ptr &repo); void updateBucketSpacesConfig(const BucketspacesConfig&); const CommunicationManagerMetrics& metrics() const noexcept { return _metrics; } diff --git a/storage/src/vespa/storage/storageserver/storagenode.cpp b/storage/src/vespa/storage/storageserver/storagenode.cpp index aa5475df823..ad98d64b173 100644 --- a/storage/src/vespa/storage/storageserver/storagenode.cpp +++ b/storage/src/vespa/storage/storageserver/storagenode.cpp @@ -249,7 +249,7 @@ StorageNode::initializeStatusWebServer() if (DIFFER(a)) { LOG(warning, "Live config failure: %s.", b); } void -StorageNode::setNewDocumentRepo(const document::DocumentTypeRepo::SP& repo) +StorageNode::setNewDocumentRepo(const std::shared_ptr& repo) { vespalib::LockGuard configLockGuard(_configLock); _context.getComponentRegister().setDocumentTypeRepo(repo); diff --git a/storage/src/vespa/storage/visiting/visitorthread.cpp b/storage/src/vespa/storage/visiting/visitorthread.cpp index 4743ac66054..718e88a2917 100644 --- a/storage/src/vespa/storage/visiting/visitorthread.cpp +++ b/storage/src/vespa/storage/visiting/visitorthread.cpp @@ -497,7 +497,7 @@ VisitorThread::onCreateVisitor( // Parse document selection try{ if (cmd->getDocumentSelection() != "") { - document::DocumentTypeRepo::SP repo( + std::shared_ptr repo( _component.getTypeRepo()); const document::BucketIdFactory& idFactory( _component.getBucketIdFactory()); diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp index 98beda4d483..d08464da715 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.cpp @@ -18,7 +18,7 @@ LOG_SETUP(".storage.api.mbusprot.serialization.base"); namespace storage::mbusprot { -ProtocolSerialization::ProtocolSerialization(const document::DocumentTypeRepo::SP& repo) +ProtocolSerialization::ProtocolSerialization(const std::shared_ptr& repo) : _repo(repo) { } diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h index 532b50ac680..c27bdfe2013 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization.h @@ -64,7 +64,7 @@ class StorageCommand; class StorageReply; class ProtocolSerialization { - const document::DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; public: virtual mbus::Blob encode(const api::StorageMessage&) const; @@ -74,10 +74,10 @@ public: protected: const document::DocumentTypeRepo& getTypeRepo() const { return *_repo; } - const document::DocumentTypeRepo::SP getTypeRepoSp() const + const std::shared_ptr getTypeRepoSp() const { return _repo; } - ProtocolSerialization(const document::DocumentTypeRepo::SP &repo); + ProtocolSerialization(const std::shared_ptr &repo); virtual ~ProtocolSerialization() {} typedef api::StorageCommand SCmd; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp index 0f8a7bc0206..2532f76f3a0 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.cpp @@ -20,7 +20,7 @@ using document::BucketSpace; namespace storage::mbusprot { ProtocolSerialization4_2::ProtocolSerialization4_2( - const document::DocumentTypeRepo::SP& repo) + const std::shared_ptr& repo) : ProtocolSerialization(repo) { } diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h index 56d832ad4f8..3a6f77e46a3 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization4_2.h @@ -7,7 +7,7 @@ namespace storage::mbusprot { class ProtocolSerialization4_2 : public ProtocolSerialization { public: - ProtocolSerialization4_2(const document::DocumentTypeRepo::SP&); + ProtocolSerialization4_2(const std::shared_ptr&); protected: void onEncode(GBBuf&, const api::GetCommand&) const override; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp index 6351818df6b..f1e96cc1631 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp @@ -111,7 +111,7 @@ ProtocolSerialization5_0::onDecodeCommand(BBuf& buf, ProtocolSerialization5_0::ProtocolSerialization5_0( - const document::DocumentTypeRepo::SP& repo, + const std::shared_ptr& repo, const documentapi::LoadTypeSet& loadTypes) : ProtocolSerialization4_2(repo), _loadTypes(loadTypes) diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h index 933be68158f..042ec7850ef 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.h @@ -11,7 +11,7 @@ private: const documentapi::LoadTypeSet& _loadTypes; public: - ProtocolSerialization5_0(const document::DocumentTypeRepo::SP&, + ProtocolSerialization5_0(const std::shared_ptr&, const documentapi::LoadTypeSet& loadTypes); document::Bucket getBucket(document::ByteBuffer& buf) const override; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp index 07bab044dca..b5c066eef7d 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.cpp @@ -44,7 +44,7 @@ ProtocolSerialization5_1::putBucketInfo( } ProtocolSerialization5_1::ProtocolSerialization5_1( - const document::DocumentTypeRepo::SP& repo, + const std::shared_ptr& repo, const documentapi::LoadTypeSet& loadTypes) : ProtocolSerialization5_0(repo, loadTypes) { diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h index ba0a7a3c6ad..5df0d757ce2 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_1.h @@ -13,7 +13,7 @@ class ProtocolSerialization5_1 : public ProtocolSerialization5_0 BUCKET_ACTIVE = 0x2, }; public: - ProtocolSerialization5_1(const document::DocumentTypeRepo::SP&, + ProtocolSerialization5_1(const std::shared_ptr&, const documentapi::LoadTypeSet& loadTypes); api::BucketInfo getBucketInfo(document::ByteBuffer& buf) const override; diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h index 18f07fc9d4a..42e9c17e192 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_2.h @@ -13,7 +13,7 @@ namespace mbusprot { class ProtocolSerialization5_2 : public ProtocolSerialization5_1 { public: - ProtocolSerialization5_2(const document::DocumentTypeRepo::SP& repo, + ProtocolSerialization5_2(const std::shared_ptr& repo, const documentapi::LoadTypeSet & loadTypes) : ProtocolSerialization5_1(repo, loadTypes) {} diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp index 7257b6bc284..930879082ed 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp @@ -6,7 +6,7 @@ namespace storage { namespace mbusprot { -ProtocolSerialization6_0::ProtocolSerialization6_0(const document::DocumentTypeRepo::SP &repo, +ProtocolSerialization6_0::ProtocolSerialization6_0(const std::shared_ptr &repo, const documentapi::LoadTypeSet &loadTypes) : ProtocolSerialization5_2(repo, loadTypes) { diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.h b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.h index 015ec33b32f..c24873f5e57 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.h +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization6_0.h @@ -16,7 +16,7 @@ namespace mbusprot { class ProtocolSerialization6_0 : public ProtocolSerialization5_2 { public: - ProtocolSerialization6_0(const document::DocumentTypeRepo::SP &repo, + ProtocolSerialization6_0(const std::shared_ptr &repo, const documentapi::LoadTypeSet &loadTypes); document::Bucket getBucket(document::ByteBuffer &buf) const override; diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp index 30d6f5bd45c..678cd1747e7 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp @@ -15,7 +15,7 @@ namespace storage::mbusprot { mbus::string StorageProtocol::NAME = "StorageProtocol"; -StorageProtocol::StorageProtocol(const document::DocumentTypeRepo::SP repo, +StorageProtocol::StorageProtocol(const std::shared_ptr repo, const documentapi::LoadTypeSet& loadTypes, bool activateBucketSpaceSerialization) : _serializer5_0(repo, loadTypes), diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h index 437be5dcbe6..d85e9d55d1a 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.h @@ -14,7 +14,7 @@ public: static mbus::string NAME; - StorageProtocol(const document::DocumentTypeRepo::SP, + StorageProtocol(const std::shared_ptr, const documentapi::LoadTypeSet& loadTypes, bool activateBucketSpaceSerialization = false); ~StorageProtocol(); diff --git a/storageserver/src/tests/storageservertest.cpp b/storageserver/src/tests/storageservertest.cpp index 03b4dfd80da..cf8c8f06330 100644 --- a/storageserver/src/tests/storageservertest.cpp +++ b/storageserver/src/tests/storageservertest.cpp @@ -298,7 +298,7 @@ namespace { public mbus::IReplyHandler { const vdstestlib::DirConfig& _config; - const document::DocumentTypeRepo::SP _repo; + const std::shared_ptr _repo; documentapi::LoadTypeSet _loadTypes; std::unique_ptr _mbus; mbus::SourceSession::UP _sourceSession; @@ -309,7 +309,7 @@ namespace { bool _startedShutdown; LoadGiver(const vdstestlib::DirConfig& config, - const document::DocumentTypeRepo::SP repo) + const std::shared_ptr repo) : _config(config), _repo(repo), _mbus(), _sourceSession(), _maxPending(20), _currentPending(0), _processedOk(0), _unexpectedErrors(0), _startedShutdown(false) {} diff --git a/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp b/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp index e24a65103a7..1f35d348e28 100644 --- a/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp +++ b/vespaclient/src/vespa/vespaclient/vesparoute/application.cpp @@ -45,7 +45,7 @@ Application::Main() return EXIT_SUCCESS; } - DocumentTypeRepo::SP repo( + std::shared_ptr repo( new DocumentTypeRepo( *ConfigGetter::getConfig(_params.getDocumentTypesConfigId()))); _net.reset(new MyNetwork(_params.getRPCNetworkParams())); -- cgit v1.2.3