diff options
author | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-04-20 11:33:42 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahoo-inc.com> | 2017-04-20 11:33:42 +0000 |
commit | 0c4c061e0a034f614eee8ea1697eea413d11e854 (patch) | |
tree | 48cdd8baaeea64d765aa88622140a78f031c564e /searchcore | |
parent | 4077f420c5fb5f6d2dcbd42bbd6bc2bf6c40094b (diff) |
Rename AttributeSpecsBuilder to AttributeAspectDelayer.
Diffstat (limited to 'searchcore')
16 files changed, 63 insertions, 65 deletions
diff --git a/searchcore/CMakeLists.txt b/searchcore/CMakeLists.txt index 8b2025462ed..3e7dfc1f45c 100644 --- a/searchcore/CMakeLists.txt +++ b/searchcore/CMakeLists.txt @@ -61,11 +61,11 @@ vespa_define_module( src/tests/fdispatch/search_path src/tests/grouping src/tests/proton/attribute + src/tests/proton/attribute/attribute_aspect_delayer src/tests/proton/attribute/attribute_directory src/tests/proton/attribute/attribute_initializer src/tests/proton/attribute/attribute_manager src/tests/proton/attribute/attribute_populator - src/tests/proton/attribute/attribute_specs_builder src/tests/proton/attribute/attribute_usage_filter src/tests/proton/attribute/attributes_state_explorer src/tests/proton/attribute/document_field_populator diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index 18a51115089..4f08d72f2c9 100644 --- a/searchcore/src/apps/tests/persistenceconformance_test.cpp +++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp @@ -27,7 +27,7 @@ LOG_SETUP("persistenceconformance_test"); #include <tests/proton/common/dummydbowner.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/searchcore/proton/common/hw_info.h> -#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h> +#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> using namespace config; @@ -113,17 +113,17 @@ public: SchemaBuilder::build(*indexschema, *schema); SchemaBuilder::build(*attributes, *schema); SchemaBuilder::build(*summary, *schema); - AttributeSpecsBuilder attributeSpecsBuilder; - attributeSpecsBuilder.setup(*attributes, SummarymapConfig()); + AttributeAspectDelayer attributeAspectDelayer; + attributeAspectDelayer.setup(*attributes, SummarymapConfig()); return DocumentDBConfig::SP(new DocumentDBConfig( 1, std::make_shared<RankProfilesConfig>(), std::make_shared<matching::RankingConstants>(), indexschema, - attributeSpecsBuilder.getAttributesConfig(), - attributeSpecsBuilder.getAttributeSpecs(), + attributeAspectDelayer.getAttributesConfig(), + attributeAspectDelayer.getAttributeSpecs(), summary, - attributeSpecsBuilder.getSummarymapConfig(), + attributeAspectDelayer.getSummarymapConfig(), std::make_shared<JuniperrcConfig>(), _typeCfg, _repo, diff --git a/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/CMakeLists.txt b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/CMakeLists.txt new file mode 100644 index 00000000000..72842d6a59a --- /dev/null +++ b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +vespa_add_executable(searchcore_attribute_aspect_delayer_test_app TEST + SOURCES + attribute_aspect_delayer_test.cpp + DEPENDS + searchcore_attribute + searchcore_pcommon +) +vespa_add_test(NAME searchcore_attribute_aspect_delayer_test_app COMMAND searchcore_attribute_aspect_delayer_test_app) diff --git a/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/DESC b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/DESC new file mode 100644 index 00000000000..0ad2e46da02 --- /dev/null +++ b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/DESC @@ -0,0 +1 @@ +attribute aspect delayer test. Take a look at attribute_aspect_delayer_test.cpp for details. diff --git a/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/FILES b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/FILES new file mode 100644 index 00000000000..459c36ca3b4 --- /dev/null +++ b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/FILES @@ -0,0 +1 @@ +attribute_aspect_delayer_test.cpp diff --git a/searchcore/src/tests/proton/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.cpp index 585ffc88414..93a63a9900d 100644 --- a/searchcore/src/tests/proton/attribute/attribute_specs_builder/attribute_specs_builder_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_aspect_delayer/attribute_aspect_delayer_test.cpp @@ -1,11 +1,9 @@ // Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("attribute_specs_builder_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/searchcore/proton/test/attribute_utils.h> -#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h> +#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> #include <vespa/searchcore/proton/attribute/attribute_specs.h> #include <vespa/searchcore/proton/common/i_document_type_inspector.h> #include <vespa/searchcore/proton/common/indexschema_inspector.h> @@ -184,12 +182,12 @@ class Fixture { MyInspector _inspector; IndexschemaConfigBuilder _oldIndexSchema; - AttributeSpecsBuilder _builder; + AttributeAspectDelayer _delayer; public: Fixture() : _inspector(), - _builder() + _delayer() { } ~Fixture() { } @@ -202,28 +200,28 @@ public: _oldIndexSchema.indexfield.emplace_back(field); } void setup(const AttributesConfig &newAttributesConfig, const SummarymapConfig &newSummarymapConfig) { - _builder.setup(newAttributesConfig, newSummarymapConfig); + _delayer.setup(newAttributesConfig, newSummarymapConfig); } void setup(const AttributesConfig &oldAttributesConfig, const SummarymapConfig &oldSummarymapConfig, const AttributesConfig &newAttributesConfig, const SummarymapConfig &newSummarymapConfig) { IndexschemaInspector indexschemaInspector(_oldIndexSchema); - _builder.setup(oldAttributesConfig, oldSummarymapConfig, + _delayer.setup(oldAttributesConfig, oldSummarymapConfig, newAttributesConfig, newSummarymapConfig, indexschemaInspector, _inspector); } void assertSpecs(const std::vector<AttributeSpec> &expSpecs) { - const auto &actSpecs = _builder.getAttributeSpecs(); + const auto &actSpecs = _delayer.getAttributeSpecs(); EXPECT_EQUAL(expSpecs, actSpecs->getSpecs()); } void assertAttributeConfig(const std::vector<AttributesConfig::Attribute> &exp) { - auto actConfig = _builder.getAttributesConfig(); + auto actConfig = _delayer.getAttributesConfig(); EXPECT_TRUE(exp == actConfig->attribute); } void assertSummarymapConfig(const std::vector<SummarymapConfig::Override> &exp) { - auto summarymapConfig = _builder.getSummarymapConfig(); + auto summarymapConfig = _delayer.getSummarymapConfig(); EXPECT_EQUAL(exp, summarymapConfig->override); } }; diff --git a/searchcore/src/tests/proton/attribute/attribute_specs_builder/CMakeLists.txt b/searchcore/src/tests/proton/attribute/attribute_specs_builder/CMakeLists.txt deleted file mode 100644 index b676722c504..00000000000 --- a/searchcore/src/tests/proton/attribute/attribute_specs_builder/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchcore_attribute_specs_builder_test_app TEST - SOURCES - attribute_specs_builder_test.cpp - DEPENDS - searchcore_attribute - searchcore_pcommon -) -vespa_add_test(NAME searchcore_attribute_specs_builder_test_app COMMAND searchcore_attribute_specs_builder_test_app) diff --git a/searchcore/src/tests/proton/attribute/attribute_specs_builder/DESC b/searchcore/src/tests/proton/attribute/attribute_specs_builder/DESC deleted file mode 100644 index 5cfe2ba2167..00000000000 --- a/searchcore/src/tests/proton/attribute/attribute_specs_builder/DESC +++ /dev/null @@ -1 +0,0 @@ -attribute specs builder test. Take a look at attribute_specs_builder_test.cpp for details. diff --git a/searchcore/src/tests/proton/attribute/attribute_specs_builder/FILES b/searchcore/src/tests/proton/attribute/attribute_specs_builder/FILES deleted file mode 100644 index 0c648bd92f6..00000000000 --- a/searchcore/src/tests/proton/attribute/attribute_specs_builder/FILES +++ /dev/null @@ -1 +0,0 @@ -attribute_specs_builder_test.cpp 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 19abad7ed03..ab786d21e79 100644 --- a/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp +++ b/searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp @@ -20,7 +20,7 @@ #include <vespa/searchcommon/common/schemaconfigurer.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/test/insertion_operators.h> -#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h> +#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> using namespace config; using namespace proton; @@ -72,17 +72,17 @@ struct DBConfigFixture { const vespalib::string &configId, const vespalib::string &docTypeName) { - AttributeSpecsBuilder attributeSpecsBuilder; - attributeSpecsBuilder.setup(_attributesBuilder, _summarymapBuilder); + AttributeAspectDelayer attributeAspectDelayer; + attributeAspectDelayer.setup(_attributesBuilder, _summarymapBuilder); return std::make_shared<DocumentDBConfig> (generation, std::make_shared<RankProfilesConfig>(_rankProfilesBuilder), buildRankingConstants(), std::make_shared<IndexschemaConfig>(_indexschemaBuilder), - attributeSpecsBuilder.getAttributesConfig(), - attributeSpecsBuilder.getAttributeSpecs(), + attributeAspectDelayer.getAttributesConfig(), + attributeAspectDelayer.getAttributeSpecs(), std::make_shared<SummaryConfig>(_summaryBuilder), - attributeSpecsBuilder.getSummarymapConfig(), + attributeAspectDelayer.getSummarymapConfig(), std::make_shared<JuniperrcConfig>(_juniperrcBuilder), documentTypes, repo, diff --git a/searchcore/src/vespa/searchcore/proton/attribute/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/attribute/CMakeLists.txt index c4e9e4f2969..cdb7b01254e 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/attribute/CMakeLists.txt @@ -2,6 +2,7 @@ vespa_add_library(searchcore_attribute STATIC SOURCES address_space_usage_stats.cpp + attribute_aspect_delayer.cpp attribute_collection_spec_factory.cpp attribute_collection_spec.cpp attribute_directory.cpp @@ -12,7 +13,6 @@ vespa_add_library(searchcore_attribute STATIC attribute_manager_initializer.cpp attribute_populator.cpp attribute_spec.cpp - attribute_specs_builder.cpp attribute_usage_filter.cpp attribute_usage_sampler_context.cpp attribute_usage_sampler_functor.cpp diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_specs_builder.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_aspect_delayer.cpp index 9abb02cf2f7..f7cc1c16554 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_specs_builder.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_aspect_delayer.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "attribute_specs_builder.h" +#include "attribute_aspect_delayer.h" #include <vespa/searchlib/attribute/configconverter.h> #include <vespa/searchcore/proton/common/i_document_type_inspector.h> #include <vespa/searchcore/proton/common/i_indexschema_inspector.h> @@ -40,37 +40,37 @@ bool willTriggerReprocessOnAttributeAspectRemoval(const search::attribute::Confi } -AttributeSpecsBuilder::AttributeSpecsBuilder() +AttributeAspectDelayer::AttributeAspectDelayer() : _specs(std::make_shared<AttributeSpecs>()), _attributesConfig(std::make_shared<AttributesConfigBuilder>()), _summarymapConfig(std::make_shared<SummarymapConfigBuilder>()) { } -AttributeSpecsBuilder::~AttributeSpecsBuilder() +AttributeAspectDelayer::~AttributeAspectDelayer() { } std::shared_ptr<const AttributeSpecs> -AttributeSpecsBuilder::getAttributeSpecs() const +AttributeAspectDelayer::getAttributeSpecs() const { return _specs; } -std::shared_ptr<AttributeSpecsBuilder::AttributesConfig> -AttributeSpecsBuilder::getAttributesConfig() const +std::shared_ptr<AttributeAspectDelayer::AttributesConfig> +AttributeAspectDelayer::getAttributesConfig() const { return _attributesConfig; } -std::shared_ptr<AttributeSpecsBuilder::SummarymapConfig> -AttributeSpecsBuilder::getSummarymapConfig() const +std::shared_ptr<AttributeAspectDelayer::SummarymapConfig> +AttributeAspectDelayer::getSummarymapConfig() const { return _summarymapConfig; } void -AttributeSpecsBuilder::setup(const AttributesConfig &newAttributesConfig, const SummarymapConfig &newSummarymapConfig) +AttributeAspectDelayer::setup(const AttributesConfig &newAttributesConfig, const SummarymapConfig &newSummarymapConfig) { for (const auto &attr : newAttributesConfig.attribute) { search::attribute::Config cfg = ConfigConverter::convert(attr); @@ -181,7 +181,7 @@ handleOldAttributes(const AttributesConfig &oldAttributesConfig, } void -AttributeSpecsBuilder::setup(const AttributesConfig &oldAttributesConfig, +AttributeAspectDelayer::setup(const AttributesConfig &oldAttributesConfig, const SummarymapConfig &oldSummarymapConfig, const AttributesConfig &newAttributesConfig, const SummarymapConfig &newSummarymapConfig, diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_specs_builder.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_aspect_delayer.h index f937c0e72a8..df4ab16c3ef 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_specs_builder.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_aspect_delayer.h @@ -21,7 +21,7 @@ class AttributeSpecs; * Class to build adjusted attribute config and vector of attribute specs * to eliminate need for reprocessing when system is online. */ -class AttributeSpecsBuilder +class AttributeAspectDelayer { using AttributesConfigBuilder = vespa::config::search::internal::InternalAttributesType; using AttributesConfig = const vespa::config::search::internal::InternalAttributesType; @@ -35,8 +35,8 @@ class AttributeSpecsBuilder std::shared_ptr<SummarymapConfigBuilder> _summarymapConfig; public: - AttributeSpecsBuilder(); - ~AttributeSpecsBuilder(); + AttributeAspectDelayer(); + ~AttributeAspectDelayer(); /* * Setup called from document db config manager and document db diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp index da17ca3fdf6..6f27d511507 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp @@ -12,7 +12,7 @@ #include <vespa/searchlib/index/schemautil.h> #include <vespa/searchsummary/config/config-juniperrc.h> #include <vespa/vespalib/time/time_box.h> -#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h> +#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> LOG_SETUP(".proton.server.documentdbconfigmanager"); @@ -269,17 +269,17 @@ DocumentDBConfigManager::update(const ConfigSnapshot &snapshot) newMaintenanceConfig = oldMaintenanceConfig; } ConfigSnapshot extraConfigs(snapshot.subset(_extraConfigKeys)); - AttributeSpecsBuilder attributeSpecsBuilder; - attributeSpecsBuilder.setup(*newAttributesConfig, *newSummarymapConfig); + AttributeAspectDelayer attributeAspectDelayer; + attributeAspectDelayer.setup(*newAttributesConfig, *newSummarymapConfig); DocumentDBConfig::SP newSnapshot( new DocumentDBConfig(generation, newRankProfilesConfig, newRankingConstants, newIndexschemaConfig, - attributeSpecsBuilder.getAttributesConfig(), - attributeSpecsBuilder.getAttributeSpecs(), + attributeAspectDelayer.getAttributesConfig(), + attributeAspectDelayer.getAttributeSpecs(), newSummaryConfig, - attributeSpecsBuilder.getSummarymapConfig(), + attributeAspectDelayer.getSummarymapConfig(), newJuniperrcConfig, _bootstrapConfig->getDocumenttypesConfigSP(), _bootstrapConfig->getDocumentTypeRepoSP(), diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp index c9329f893dc..2c3fc20128f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp @@ -3,7 +3,7 @@ #include <vespa/fastos/fastos.h> #include "documentdbconfigscout.h" #include <vespa/searchcore/proton/attribute/attributesconfigscout.h> -#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h> +#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> using vespa::config::search::AttributesConfig; @@ -20,10 +20,10 @@ DocumentDBConfigScout::scout(const DocumentDBConfig::SP &config, ac(acScout.adjust(config->getAttributesConfig())); if (*ac == config->getAttributesConfig()) return config; // no change - AttributeSpecsBuilder attributeSpecsBuilder; - attributeSpecsBuilder.setup(*ac, config->getSummarymapConfig()); - return config->newFromAttributesConfig(attributeSpecsBuilder.getAttributesConfig(), - attributeSpecsBuilder.getAttributeSpecs()); + AttributeAspectDelayer attributeAspectDelayer; + attributeAspectDelayer.setup(*ac, config->getSummarymapConfig()); + return config->newFromAttributesConfig(attributeAspectDelayer.getAttributesConfig(), + attributeAspectDelayer.getAttributeSpecs()); } diff --git a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp index 47955993ffd..dd20ce44f46 100644 --- a/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp +++ b/searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp @@ -9,7 +9,7 @@ #include <vespa/searchsummary/config/config-juniperrc.h> #include <vespa/document/config/config-documenttypes.h> #include <vespa/config-imported-fields.h> -#include <vespa/searchcore/proton/attribute/attribute_specs_builder.h> +#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h> using document::DocumenttypesConfig; using search::TuneFileDocumentDB; @@ -74,17 +74,17 @@ DocumentDBConfigBuilder::DocumentDBConfigBuilder(const DocumentDBConfig &cfg) DocumentDBConfig::SP DocumentDBConfigBuilder::build() { - AttributeSpecsBuilder attributeSpecsBuilder; - attributeSpecsBuilder.setup(*_attributes, *_summarymap); + AttributeAspectDelayer attributeAspectDelayer; + attributeAspectDelayer.setup(*_attributes, *_summarymap); return std::make_shared<DocumentDBConfig>( _generation, _rankProfiles, _rankingConstants, _indexschema, - attributeSpecsBuilder.getAttributesConfig(), - attributeSpecsBuilder.getAttributeSpecs(), + attributeAspectDelayer.getAttributesConfig(), + attributeAspectDelayer.getAttributeSpecs(), _summary, - attributeSpecsBuilder.getSummarymapConfig(), + attributeAspectDelayer.getSummarymapConfig(), _juniperrc, _documenttypes, _repo, |