diff options
36 files changed, 53 insertions, 46 deletions
diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp index 410ac539ff4..05ec2ce99d0 100644 --- a/document/src/tests/documentselectparsertest.cpp +++ b/document/src/tests/documentselectparsertest.cpp @@ -118,7 +118,7 @@ public: CPPUNIT_TEST_SUITE_REGISTRATION(DocumentSelectParserTest); namespace { - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; } void DocumentSelectParserTest::setUp() diff --git a/document/src/tests/fieldpathupdatetestcase.cpp b/document/src/tests/fieldpathupdatetestcase.cpp index 70f16eccfe1..cade696e06c 100644 --- a/document/src/tests/fieldpathupdatetestcase.cpp +++ b/document/src/tests/fieldpathupdatetestcase.cpp @@ -23,7 +23,7 @@ namespace document { using namespace fieldvalue; struct FieldPathUpdateTestCase : public CppUnit::TestFixture { - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; DocumentType _foobar_type; void setUp() override; diff --git a/document/src/vespa/document/base/testdocman.cpp b/document/src/vespa/document/base/testdocman.cpp index 830b36ef926..206ac018248 100644 --- a/document/src/vespa/document/base/testdocman.cpp +++ b/document/src/vespa/document/base/testdocman.cpp @@ -63,7 +63,7 @@ TestDocMan::TestDocMan() TestDocMan::~TestDocMan() { } void -TestDocMan::setTypeRepo(const DocumentTypeRepo::SP &repo) +TestDocMan::setTypeRepo(const std::shared_ptr<const DocumentTypeRepo> &repo) { _repo = repo; _typeCfg = NULL; diff --git a/document/src/vespa/document/base/testdocman.h b/document/src/vespa/document/base/testdocman.h index 7d2e949c6c3..98398d5569b 100644 --- a/document/src/vespa/document/base/testdocman.h +++ b/document/src/vespa/document/base/testdocman.h @@ -21,7 +21,6 @@ #include "testdocrepo.h" #include <vespa/document/datatype/datatypes.h> #include <vespa/document/fieldvalue/fieldvalues.h> -#include <vespa/document/repo/documenttyperepo.h> #include <memory> #include <vector> @@ -29,17 +28,17 @@ namespace document { class TestDocMan { static std::vector<char> _buffer; TestDocRepo _test_repo; - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; const DocumenttypesConfig *_typeCfg; public: TestDocMan(); ~TestDocMan(); - void setTypeRepo(const DocumentTypeRepo::SP &repo); + void setTypeRepo(const std::shared_ptr<const DocumentTypeRepo> &repo); const DocumentTypeRepo& getTypeRepo() const { return *_repo; } - const DocumentTypeRepo::SP getTypeRepoSP() const { return _repo; } + std::shared_ptr<const DocumentTypeRepo> getTypeRepoSP() const { return _repo; } const DocumenttypesConfig *getTypeConfig() const { return _typeCfg; } /** Create test document. */ diff --git a/document/src/vespa/document/base/testdocrepo.cpp b/document/src/vespa/document/base/testdocrepo.cpp index 39181f5e5b3..026d29ed3b0 100644 --- a/document/src/vespa/document/base/testdocrepo.cpp +++ b/document/src/vespa/document/base/testdocrepo.cpp @@ -2,6 +2,7 @@ #include "testdocrepo.h" #include <vespa/document/datatype/documenttype.h> +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/repo/configbuilder.h> #include <vespa/config/print/fileconfigreader.h> diff --git a/document/src/vespa/document/base/testdocrepo.h b/document/src/vespa/document/base/testdocrepo.h index 5c37d54e707..e6d7fc788fb 100644 --- a/document/src/vespa/document/base/testdocrepo.h +++ b/document/src/vespa/document/base/testdocrepo.h @@ -4,13 +4,14 @@ #include <vespa/document/config/config-documenttypes.h> #include <vespa/document/datatype/datatype.h> -#include <vespa/document/repo/documenttyperepo.h> namespace document { +class DocumentTypeRepo; + class TestDocRepo { DocumenttypesConfig _cfg; - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; public: TestDocRepo(); @@ -19,7 +20,7 @@ public: static DocumenttypesConfig getDefaultConfig(); const DocumentTypeRepo& getTypeRepo() const { return *_repo; } - const DocumentTypeRepo::SP getTypeRepoSp() const { return _repo; } + std::shared_ptr<const DocumentTypeRepo> getTypeRepoSp() const { return _repo; } const DocumenttypesConfig& getTypeConfig() const { return _cfg; } const DataType* getDocumentType(const vespalib::string &name) const; }; diff --git a/document/src/vespa/document/fieldset/fieldsetrepo.cpp b/document/src/vespa/document/fieldset/fieldsetrepo.cpp index 5402a7113cb..e1e2ed35ca6 100644 --- a/document/src/vespa/document/fieldset/fieldsetrepo.cpp +++ b/document/src/vespa/document/fieldset/fieldsetrepo.cpp @@ -4,6 +4,7 @@ #include <vespa/vespalib/text/stringtokenizer.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/stllike/asciistream.h> +#include <vespa/document/repo/documenttyperepo.h> using vespalib::StringTokenizer; diff --git a/document/src/vespa/document/fieldset/fieldsetrepo.h b/document/src/vespa/document/fieldset/fieldsetrepo.h index f48b57f63d8..d0bff0d60c8 100644 --- a/document/src/vespa/document/fieldset/fieldsetrepo.h +++ b/document/src/vespa/document/fieldset/fieldsetrepo.h @@ -4,10 +4,11 @@ #include <vespa/document/fieldset/fieldset.h> #include <vespa/document/fieldset/fieldsets.h> #include <vespa/document/datatype/documenttype.h> -#include <vespa/document/repo/documenttyperepo.h> namespace document { +class DocumentTypeRepo; + /** * Class that has configuration for all document field sets. * Responsible for parsing field set strings using a documenttype. diff --git a/document/src/vespa/document/repo/documenttyperepo.h b/document/src/vespa/document/repo/documenttyperepo.h index 3e0f2564819..3d4caee15c6 100644 --- a/document/src/vespa/document/repo/documenttyperepo.h +++ b/document/src/vespa/document/repo/documenttyperepo.h @@ -23,7 +23,7 @@ class DocumentTypeRepo { public: using DocumenttypesConfig = const internal::InternalDocumenttypesType; - typedef std::shared_ptr<DocumentTypeRepo> SP; + typedef std::shared_ptr<const DocumentTypeRepo> SP; typedef std::unique_ptr<DocumentTypeRepo> UP; // This one should only be used for testing. If you do not have any config. diff --git a/document/src/vespa/document/select/parser.h b/document/src/vespa/document/select/parser.h index 35d710298c3..c4e686a120e 100644 --- a/document/src/vespa/document/select/parser.h +++ b/document/src/vespa/document/select/parser.h @@ -4,10 +4,11 @@ #include "node.h" #include "parsing_failed_exception.h" #include <vespa/document/bucket/bucketidfactory.h> -#include <vespa/document/repo/documenttyperepo.h> #include <memory> #include <string> +namespace document { class DocumentTypeRepo; } + namespace document::select { /** diff --git a/documentapi/src/tests/messagebus/messagebus_test.cpp b/documentapi/src/tests/messagebus/messagebus_test.cpp index 077ea52e255..cd2820d8c05 100644 --- a/documentapi/src/tests/messagebus/messagebus_test.cpp +++ b/documentapi/src/tests/messagebus/messagebus_test.cpp @@ -3,6 +3,7 @@ #include <vespa/document/base/testdocrepo.h> #include <vespa/document/datatype/documenttype.h> #include <vespa/document/fieldvalue/document.h> +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/documentapi/documentapi.h> #include <vespa/documentapi/loadtypes/loadtypeset.h> #include <vespa/vdslib/state/clusterstate.h> @@ -16,7 +17,7 @@ using mbus::Routable; using mbus::IRoutingPolicy; class Test : public vespalib::TestApp { - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; public: Test(); diff --git a/documentapi/src/tests/messages/messages50test.cpp b/documentapi/src/tests/messages/messages50test.cpp index 161f976c3d5..0346cadbf9b 100644 --- a/documentapi/src/tests/messages/messages50test.cpp +++ b/documentapi/src/tests/messages/messages50test.cpp @@ -4,6 +4,7 @@ #include <vespa/document/bucket/bucketidfactory.h> #include <vespa/document/datatype/documenttype.h> #include <vespa/document/select/parser.h> +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/update/fieldpathupdates.h> #include <vespa/documentapi/documentapi.h> diff --git a/documentapi/src/tests/messages/messages52test.cpp b/documentapi/src/tests/messages/messages52test.cpp index 642fbc2fc41..eaf8bbec8c4 100644 --- a/documentapi/src/tests/messages/messages52test.cpp +++ b/documentapi/src/tests/messages/messages52test.cpp @@ -4,6 +4,7 @@ #include "messages52test.h" #include <vespa/documentapi/documentapi.h> +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/update/fieldpathupdates.h> #include <vespa/document/datatype/documenttype.h> diff --git a/documentapi/src/tests/messages/testbase.cpp b/documentapi/src/tests/messages/testbase.cpp index 8f2729964a6..02c180853d4 100644 --- a/documentapi/src/tests/messages/testbase.cpp +++ b/documentapi/src/tests/messages/testbase.cpp @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "testbase.h" +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/base/testdocrepo.h> #include <vespa/vespalib/util/exception.h> #include <fcntl.h> diff --git a/documentapi/src/tests/messages/testbase.h b/documentapi/src/tests/messages/testbase.h index 2a1bb61c761..e47858cda4b 100644 --- a/documentapi/src/tests/messages/testbase.h +++ b/documentapi/src/tests/messages/testbase.h @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/document/repo/documenttyperepo.h> #include <vespa/documentapi/messagebus/documentprotocol.h> #include <vespa/documentapi/loadtypes/loadtypeset.h> #include <vespa/messagebus/routable.h> @@ -23,7 +22,7 @@ typedef bool (TestBase::*TEST_METHOD_PT)(); * tests to it. */ class TestBase : public vespalib::TestApp { - const document::DocumentTypeRepo::SP _repo; + std::shared_ptr<const document::DocumentTypeRepo> _repo; protected: const string _dataPath; LoadTypeSet _loadTypes; @@ -46,7 +45,7 @@ protected: public: const document::DocumentTypeRepo &getTypeRepo() { return *_repo; } - const document::DocumentTypeRepo::SP &getTypeRepoSp() { return _repo; } + std::shared_ptr<const document::DocumentTypeRepo> &getTypeRepoSp() { return _repo; } bool testCoverage(const std::vector<uint32_t> &expected, const std::vector<uint32_t> &actual, bool report = false) const; bool writeFile(const string &filename, const mbus::Blob& blob) const; diff --git a/documentapi/src/tests/policies/policies_test.cpp b/documentapi/src/tests/policies/policies_test.cpp index 13c3323175a..7852136dfc7 100644 --- a/documentapi/src/tests/policies/policies_test.cpp +++ b/documentapi/src/tests/policies/policies_test.cpp @@ -21,6 +21,7 @@ #include <vespa/document/base/testdocrepo.h> #include <vespa/document/fieldvalue/longfieldvalue.h> #include <vespa/document/datatype/documenttype.h> +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/stringfmt.h> @@ -42,7 +43,7 @@ using std::make_shared; class Test : public vespalib::TestApp { private: LoadTypeSet _loadTypes; - DocumentTypeRepo::SP _repo; + std::shared_ptr<const DocumentTypeRepo> _repo; const DataType *_docType; private: @@ -669,7 +670,7 @@ createDocumentRouteSelectorConfigWithTwoRoutes() } std::unique_ptr<TestFrame> -createFrameWithTwoRoutes(DocumentTypeRepo::SP repo) +createFrameWithTwoRoutes(std::shared_ptr<const DocumentTypeRepo> repo) { auto result = std::make_unique<TestFrame>(repo); result->setHop(mbus::HopSpec("test", createDocumentRouteSelectorConfigWithTwoRoutes()) diff --git a/documentapi/src/tests/policies/testframe.cpp b/documentapi/src/tests/policies/testframe.cpp index 877e3164a8c..024a0c2fdaa 100644 --- a/documentapi/src/tests/policies/testframe.cpp +++ b/documentapi/src/tests/policies/testframe.cpp @@ -61,7 +61,7 @@ public: } }; -TestFrame::TestFrame(const DocumentTypeRepo::SP &repo, const string &ident) : +TestFrame::TestFrame(const std::shared_ptr<const DocumentTypeRepo> &repo, const string &ident) : _identity(ident), _slobrok(new mbus::Slobrok()), _set(), diff --git a/documentapi/src/tests/policies/testframe.h b/documentapi/src/tests/policies/testframe.h index 9a43a7367ea..15ec61aff7b 100644 --- a/documentapi/src/tests/policies/testframe.h +++ b/documentapi/src/tests/policies/testframe.h @@ -9,7 +9,6 @@ #include <vespa/messagebus/testlib/receptor.h> #include <vespa/messagebus/testlib/slobrok.h> #include <vespa/documentapi/loadtypes/loadtypeset.h> -#include <vespa/document/repo/documenttyperepo.h> using documentapi::string; @@ -37,7 +36,7 @@ public: * * @param identity The identity to use for the server. */ - TestFrame(const document::DocumentTypeRepo::SP &repo, + TestFrame(const std::shared_ptr<const document::DocumentTypeRepo> &repo, const string &ident = "anonymous"); /** diff --git a/documentapi/src/tests/policyfactory/policyfactory.cpp b/documentapi/src/tests/policyfactory/policyfactory.cpp index f3dadab54ce..ef8c461ad02 100644 --- a/documentapi/src/tests/policyfactory/policyfactory.cpp +++ b/documentapi/src/tests/policyfactory/policyfactory.cpp @@ -78,7 +78,7 @@ Test::Main() { TEST_INIT("policyfactory_test"); - DocumentTypeRepo::SP repo(new DocumentTypeRepo); + std::shared_ptr<const DocumentTypeRepo> repo(new DocumentTypeRepo); mbus::Slobrok slobrok; LoadTypeSet loadTypes; mbus::TestServer diff --git a/documentapi/src/tests/routablefactory/routablefactory.cpp b/documentapi/src/tests/routablefactory/routablefactory.cpp index 7ab320c662d..1abecdbf6c5 100644 --- a/documentapi/src/tests/routablefactory/routablefactory.cpp +++ b/documentapi/src/tests/routablefactory/routablefactory.cpp @@ -83,7 +83,7 @@ protected: /////////////////////////////////////////////////////////////////////////////// class TestData { - const DocumentTypeRepo::SP _repo; + const std::shared_ptr<const DocumentTypeRepo> _repo; public: mbus::Slobrok _slobrok; diff --git a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp index fa3a8280f95..d92fbdfb941 100644 --- a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp +++ b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.cpp @@ -24,7 +24,7 @@ namespace documentapi { const mbus::string DocumentProtocol::NAME = "document"; DocumentProtocol::DocumentProtocol(const LoadTypeSet& loadTypes, - DocumentTypeRepo::SP repo, + std::shared_ptr<const DocumentTypeRepo> repo, const string &configId) : _routingPolicyRepository(new RoutingPolicyRepository()), _routableRepository(new RoutableRepository(loadTypes)), diff --git a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h index aea3f390c71..0a6c10ace77 100644 --- a/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h +++ b/documentapi/src/vespa/documentapi/messagebus/documentprotocol.h @@ -29,7 +29,7 @@ private: std::unique_ptr<RoutingPolicyRepository> _routingPolicyRepository; std::unique_ptr<RoutableRepository> _routableRepository; std::unique_ptr<SystemState> _systemState; - std::shared_ptr<document::DocumentTypeRepo> _repo; + std::shared_ptr<const document::DocumentTypeRepo> _repo; public: /** @@ -199,7 +199,7 @@ public: * @param configId The id to use when subscribing to config. */ DocumentProtocol(const LoadTypeSet& loadTypes, - std::shared_ptr<document::DocumentTypeRepo> repo, + std::shared_ptr<const document::DocumentTypeRepo> repo, const string &configId = ""); ~DocumentProtocol(); diff --git a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h index 37a7f6d7e61..e052eff78c3 100644 --- a/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h +++ b/documentapi/src/vespa/documentapi/messagebus/routablefactories50.h @@ -6,9 +6,6 @@ #include <vespa/documentapi/messagebus/messages/putdocumentmessage.h> #include <vespa/documentapi/messagebus/messages/removedocumentmessage.h> #include <vespa/documentapi/messagebus/messages/updatedocumentmessage.h> -#include <vespa/document/repo/documenttyperepo.h> - - namespace document { class DocumentTypeRepo; } diff --git a/documentapi/src/vespa/documentapi/messagebus/routingpolicyfactories.h b/documentapi/src/vespa/documentapi/messagebus/routingpolicyfactories.h index 003768aedda..05202ad0de9 100644 --- a/documentapi/src/vespa/documentapi/messagebus/routingpolicyfactories.h +++ b/documentapi/src/vespa/documentapi/messagebus/routingpolicyfactories.h @@ -3,7 +3,8 @@ #include "iroutingpolicyfactory.h" #include <vespa/documentapi/messagebus/systemstate/systemstate.h> -#include <vespa/document/repo/documenttyperepo.h> + +namespace document { class DocumentTypeRepo; } namespace documentapi { diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp index 51763b20f14..3cd4598d8a7 100644 --- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp @@ -21,7 +21,7 @@ namespace DDBCSP getConfig(int64_t generation, const Schema::SP &schema, - shared_ptr<DocumentTypeRepo> repo, + shared_ptr<const DocumentTypeRepo> repo, const AttributesConfig &attributes) { return test::DocumentDBConfigBuilder(generation, schema, "client", "test"). @@ -232,7 +232,7 @@ TEST("Test that DocumentDBConfigScout::scout looks ahead") AttributesConfigBuilder liveAttributes; setupLiveAttributes(liveAttributes.attribute); - shared_ptr<DocumentTypeRepo> repo(make_shared<DocumentTypeRepo>()); + shared_ptr<const DocumentTypeRepo> repo(make_shared<DocumentTypeRepo>()); Schema::SP schema(make_shared<Schema>()); DDBCSP cfg = getConfig(4, schema, repo, attributes); DDBCSP liveCfg = getConfig(4, schema, repo, liveAttributes); diff --git a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp index 91b310e3925..e41758fdb22 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/feedstates.cpp @@ -5,12 +5,14 @@ #include "ifeedview.h" #include "ireplayconfig.h" #include "replaypacketdispatcher.h" +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/searchcore/proton/bucketdb/ibucketdbhandler.h> #include <vespa/searchcore/proton/common/eventlogger.h> #include <vespa/searchlib/common/idestructorcallback.h> #include <vespa/vespalib/util/closuretask.h> #include <vespa/vespalib/util/exceptions.h> + #include <vespa/log/log.h> LOG_SETUP(".proton.server.feedstates"); @@ -127,7 +129,7 @@ public: virtual NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() override { return _config_store; } - virtual document::DocumentTypeRepo &getDeserializeRepo() override { + virtual const document::DocumentTypeRepo &getDeserializeRepo() override { return *_feed_view_ptr->getDocumentTypeRepo(); } }; diff --git a/searchcore/src/vespa/searchcore/proton/server/ifeedview.h b/searchcore/src/vespa/searchcore/proton/server/ifeedview.h index 3e1635d0f33..3ded41180d5 100644 --- a/searchcore/src/vespa/searchcore/proton/server/ifeedview.h +++ b/searchcore/src/vespa/searchcore/proton/server/ifeedview.h @@ -34,7 +34,7 @@ public: IFeedView & operator = (const IFeedView &) = delete; virtual ~IFeedView() { } - virtual const std::shared_ptr<document::DocumentTypeRepo> &getDocumentTypeRepo() const = 0; + virtual const std::shared_ptr<const document::DocumentTypeRepo> &getDocumentTypeRepo() const = 0; /** * Access to const version of document meta store. diff --git a/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h b/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h index 01307750606..210ece3a36a 100644 --- a/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h +++ b/searchcore/src/vespa/searchcore/proton/server/ireplaypackethandler.h @@ -30,7 +30,7 @@ struct IReplayPacketHandler virtual void replay(const CompactLidSpaceOperation &op) = 0; virtual NewConfigOperation::IStreamHandler &getNewConfigStreamHandler() = 0; - virtual document::DocumentTypeRepo &getDeserializeRepo() = 0; + virtual const document::DocumentTypeRepo &getDeserializeRepo() = 0; }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp index f2deb456090..ff39ed89999 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.cpp @@ -178,7 +178,7 @@ ProtonConfigFetcher::close() } void -ProtonConfigFetcher::rememberDocumentTypeRepo(std::shared_ptr<document::DocumentTypeRepo> repo) +ProtonConfigFetcher::rememberDocumentTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo) { // Ensure that previous document type repo is kept alive, and also // any document type repo that was current within last 10 minutes. diff --git a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.h b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.h index 8ba56deb7e8..252d8e6dc0e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.h +++ b/searchcore/src/vespa/searchcore/proton/server/proton_config_fetcher.h @@ -50,7 +50,7 @@ private: typedef std::map<DocTypeName, DocumentDBConfigManager::SP> DBManagerMap; using Clock = std::chrono::steady_clock; using TimePoint = std::chrono::time_point<Clock>; - using OldDocumentTypeRepo = std::pair<TimePoint, std::shared_ptr<document::DocumentTypeRepo>>; + using OldDocumentTypeRepo = std::pair<TimePoint, std::shared_ptr<const document::DocumentTypeRepo>>; BootstrapConfigManager _bootstrapConfigManager; config::ConfigRetriever _retriever; @@ -62,13 +62,13 @@ private: FastOS_ThreadPool _threadPool; std::deque<OldDocumentTypeRepo> _oldDocumentTypeRepos; - std::shared_ptr<document::DocumentTypeRepo> _currentDocumentTypeRepo; + std::shared_ptr<const document::DocumentTypeRepo> _currentDocumentTypeRepo; void fetchConfigs(); void updateDocumentDBConfigs(const BootstrapConfigSP & config, const config::ConfigSnapshot & snapshot); void reconfigure(); const config::ConfigKeySet pruneManagerMap(const BootstrapConfigSP & config); - void rememberDocumentTypeRepo(std::shared_ptr<document::DocumentTypeRepo> repo); + void rememberDocumentTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo); }; } // namespace proton diff --git a/storage/src/vespa/storage/common/storagecomponent.h b/storage/src/vespa/storage/common/storagecomponent.h index e136d991ac5..168bdbe9aa6 100644 --- a/storage/src/vespa/storage/common/storagecomponent.h +++ b/storage/src/vespa/storage/common/storagecomponent.h @@ -60,7 +60,7 @@ class StorageComponent : public framework::Component { public: using UP = std::unique_ptr<StorageComponent>; using PriorityConfig = vespa::config::content::core::internal::InternalStorPrioritymappingType; - using DocumentTypeRepoSP = std::shared_ptr<document::DocumentTypeRepo>; + using DocumentTypeRepoSP = std::shared_ptr<const document::DocumentTypeRepo>; using LoadTypeSetSP = std::shared_ptr<documentapi::LoadTypeSet>; using DistributionSP = std::shared_ptr<lib::Distribution>; diff --git a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp index c7ba3d8f4cd..9fa7a319fa9 100644 --- a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp @@ -660,7 +660,7 @@ void VisitorOperation::attemptToParseOrderingSelector() { std::unique_ptr<document::select::Node> docSelection; - std::shared_ptr<document::DocumentTypeRepo> repo(_owner.getTypeRepo()); + std::shared_ptr<const document::DocumentTypeRepo> repo(_owner.getTypeRepo()); document::select::Parser parser( *repo, _owner.getBucketIdFactory()); docSelection = parser.parse(_msg->getDocumentSelection()); diff --git a/storage/src/vespa/storage/persistence/mergehandler.cpp b/storage/src/vespa/storage/persistence/mergehandler.cpp index e17be7479f0..c3dc7cba80a 100644 --- a/storage/src/vespa/storage/persistence/mergehandler.cpp +++ b/storage/src/vespa/storage/persistence/mergehandler.cpp @@ -616,7 +616,7 @@ MergeHandler::applyDiffLocally( FlushGuard flushGuard(_spi, bucket, context); - std::shared_ptr<document::DocumentTypeRepo> repo(_env._component.getTypeRepo()); + std::shared_ptr<const document::DocumentTypeRepo> repo(_env._component.getTypeRepo()); assert(repo.get() != nullptr); uint32_t existingCount = entries.size(); diff --git a/storage/src/vespa/storage/persistence/persistenceutil.h b/storage/src/vespa/storage/persistence/persistenceutil.h index bf347ccb10a..0eba334c81d 100644 --- a/storage/src/vespa/storage/persistence/persistenceutil.h +++ b/storage/src/vespa/storage/persistence/persistenceutil.h @@ -68,7 +68,7 @@ struct PersistenceUtil { uint16_t _nodeIndex; FileStorThreadMetrics& _metrics; const document::BucketIdFactory& _bucketFactory; - const std::shared_ptr<document::DocumentTypeRepo> _repo; + const std::shared_ptr<const document::DocumentTypeRepo> _repo; spi::PersistenceProvider& _spi; PersistenceUtil( diff --git a/storage/src/vespa/storage/storageserver/storagenode.h b/storage/src/vespa/storage/storageserver/storagenode.h index c8739442c13..a19fb2c0d64 100644 --- a/storage/src/vespa/storage/storageserver/storagenode.h +++ b/storage/src/vespa/storage/storageserver/storagenode.h @@ -82,7 +82,7 @@ public: void updateMetrics(const MetricLockGuard & guard) override; /** Updates the document type repo. */ - void setNewDocumentRepo(const std::shared_ptr<document::DocumentTypeRepo>& repo); + void setNewDocumentRepo(const std::shared_ptr<const document::DocumentTypeRepo>& repo); /** * Pauses the persistence processing. While the returned ResumeGuard diff --git a/storageserver/src/vespa/storageserver/app/process.h b/storageserver/src/vespa/storageserver/app/process.h index bbffca30593..f566671d1af 100644 --- a/storageserver/src/vespa/storageserver/app/process.h +++ b/storageserver/src/vespa/storageserver/app/process.h @@ -28,7 +28,7 @@ class StorageNodeContext; class Process : public ApplicationGenerationFetcher { protected: - using DocumentTypeRepoSP = std::shared_ptr<document::DocumentTypeRepo>; + using DocumentTypeRepoSP = std::shared_ptr<const document::DocumentTypeRepo>; config::ConfigUri _configUri; DocumentTypeRepoSP getTypeRepo() { return _repos.back(); } config::ConfigSubscriber _configSubscriber; |