diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-04-04 14:05:50 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-04-04 14:11:05 +0000 |
commit | 91a0164390282d89b5b295142e4f06ce27afdbc2 (patch) | |
tree | 5645cc655627e2c1d44170cbc8c20e5c30af320a /searchcore | |
parent | 02227976fd12c40beb2fcfd2361c52e02b9f06ab (diff) |
Start using DocumentTypeRepoFactory.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp | 4 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp index 9f0d694aa57..0c2870ad35d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp @@ -2,6 +2,7 @@ #include "bootstrapconfigmanager.h" #include "bootstrapconfig.h" +#include <vespa/document/repo/document_type_repo_factory.h> #include <vespa/searchcore/proton/common/hw_info_sampler.h> #include <vespa/config-bucketspaces.h> #include <vespa/searchlib/common/tunefileinfo.hpp> @@ -19,6 +20,7 @@ using vespa::config::search::core::ProtonConfig; using cloud::config::filedistribution::FiledistributorrpcConfig; using vespa::config::content::core::BucketspacesConfig; using document::DocumenttypesConfig; +using document::DocumentTypeRepoFactory; using BucketspacesConfigSP = std::shared_ptr<BucketspacesConfig>; namespace proton { @@ -99,7 +101,7 @@ BootstrapConfigManager::update(const ConfigSnapshot & snapshot) if (snapshot.isChanged<DocumenttypesConfig>(_configId, currentGen)) { LOG(spam, "Documenttypes config is changed"); newDocumenttypesConfig = snapshot.getConfig<DocumenttypesConfig>(_configId); - newRepo = std::make_shared<DocumentTypeRepo>(*newDocumenttypesConfig); + newRepo = DocumentTypeRepoFactory::make(*newDocumenttypesConfig); } if (snapshot.isChanged<BucketspacesConfig>(_configId, currentGen)) { LOG(spam, "Bucketspaces config is changed"); diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp index e017d9b81d4..76f2ffce93a 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp @@ -7,6 +7,7 @@ #include <vespa/config/print/fileconfigsnapshotreader.h> #include <vespa/config/print/fileconfigsnapshotwriter.h> #include <vespa/config-bucketspaces.h> +#include <vespa/document/repo/document_type_repo_factory.h> #include <vespa/searchcommon/common/schemaconfigurer.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/config-summarymap.h> @@ -20,6 +21,7 @@ LOG_SETUP(".proton.server.fileconfigmanager"); using document::DocumentTypeRepo; +using document::DocumentTypeRepoFactory; using document::DocumenttypesConfig; using search::IndexMetaInfo; using search::SerialNum; @@ -347,7 +349,7 @@ FileConfigManager::loadConfig(const DocumentDBConfig ¤tSnapshot, docTypesCfg = currentSnapshot.getDocumenttypesConfigSP(); repo = currentSnapshot.getDocumentTypeRepoSP(); } else { - repo.reset(new DocumentTypeRepo(*docTypesCfg)); + repo = DocumentTypeRepoFactory::make(*docTypesCfg); } auto filedistRpcConf = std::make_shared<FiledistributorrpcConfig>(); |