// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "documentdb_config_builder.h" #include #include #include #include #include #include #include #include #include #include #include using search::TuneFileDocumentDB; using search::index::Schema; using vespa::config::search::RankProfilesConfig; using vespa::config::search::IndexschemaConfig; using vespa::config::search::AttributesConfig; using vespa::config::search::SummaryConfig; using vespa::config::search::summary::JuniperrcConfig; using vespa::config::search::ImportedFieldsConfig; using proton::ThreadingServiceConfig; namespace proton::test { DocumentDBConfigBuilder::DocumentDBConfigBuilder(int64_t generation, const search::index::Schema::SP &schema, const vespalib::string &configId, const vespalib::string &docTypeName) : _generation(generation), _rankProfiles(std::make_shared()), _rankingConstants(std::make_shared()), _rankingExpressions(std::make_shared()), _onnxModels(std::make_shared()), _indexschema(std::make_shared()), _attributes(std::make_shared()), _summary(std::make_shared()), _juniperrc(std::make_shared()), _documenttypes(std::make_shared()), _repo(std::make_shared()), _importedFields(std::make_shared()), _tuneFileDocumentDB(std::make_shared()), _schema(schema), _maintenance(std::make_shared()), _store(), _threading_service_config(ThreadingServiceConfig::make()), _alloc_config(AllocConfig::makeDefault()), _configId(configId), _docTypeName(docTypeName) { } DocumentDBConfigBuilder::DocumentDBConfigBuilder(const DocumentDBConfig &cfg) : _generation(cfg.getGeneration()), _rankProfiles(cfg.getRankProfilesConfigSP()), _rankingConstants(cfg.getRankingConstantsSP()), _rankingExpressions(cfg.getRankingExpressionsSP()), _onnxModels(cfg.getOnnxModelsSP()), _indexschema(cfg.getIndexschemaConfigSP()), _attributes(cfg.getAttributesConfigSP()), _summary(cfg.getSummaryConfigSP()), _juniperrc(cfg.getJuniperrcConfigSP()), _documenttypes(cfg.getDocumenttypesConfigSP()), _repo(cfg.getDocumentTypeRepoSP()), _importedFields(cfg.getImportedFieldsConfigSP()), _tuneFileDocumentDB(cfg.getTuneFileDocumentDBSP()), _schema(cfg.getSchemaSP()), _maintenance(cfg.getMaintenanceConfigSP()), _store(cfg.getStoreConfig()), _threading_service_config(cfg.get_threading_service_config()), _alloc_config(cfg.get_alloc_config()), _configId(cfg.getConfigId()), _docTypeName(cfg.getDocTypeName()) {} DocumentDBConfigBuilder::~DocumentDBConfigBuilder() = default; DocumentDBConfig::SP DocumentDBConfigBuilder::build() { return std::make_shared( _generation, _rankProfiles, _rankingConstants, _rankingExpressions, _onnxModels, _indexschema, _attributes, _summary, _juniperrc, _documenttypes, _repo, _importedFields, _tuneFileDocumentDB, _schema, _maintenance, _store, _threading_service_config, _alloc_config, _configId, _docTypeName); } }