summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp8
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp26
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp14
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp8
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp17
-rw-r--r--searchcore/src/tests/proton/proton_configurer/proton_configurer_test.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp15
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/documentdb_config_builder.cpp8
18 files changed, 59 insertions, 111 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp
index 4f08d72f2c9..75c37394e83 100644
--- a/searchcore/src/apps/tests/persistenceconformance_test.cpp
+++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp
@@ -27,7 +27,6 @@ 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_aspect_delayer.h>
using namespace config;
@@ -113,17 +112,14 @@ public:
SchemaBuilder::build(*indexschema, *schema);
SchemaBuilder::build(*attributes, *schema);
SchemaBuilder::build(*summary, *schema);
- AttributeAspectDelayer attributeAspectDelayer;
- attributeAspectDelayer.setup(*attributes, SummarymapConfig());
return DocumentDBConfig::SP(new DocumentDBConfig(
1,
std::make_shared<RankProfilesConfig>(),
std::make_shared<matching::RankingConstants>(),
indexschema,
- attributeAspectDelayer.getAttributesConfig(),
- attributeAspectDelayer.getAttributeSpecs(),
+ attributes,
summary,
- attributeAspectDelayer.getSummarymapConfig(),
+ std::make_shared<SummarymapConfig>(),
std::make_shared<JuniperrcConfig>(),
_typeCfg,
_repo,
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
index 4e33a433655..2036c6e1145 100644
--- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
@@ -225,12 +225,12 @@ struct ParallelAttributeManager
AttributeManagerInitializer::SP initializer;
ParallelAttributeManager(search::SerialNum configSerialNum, AttributeManager::SP baseAttrMgr,
- const AttributeSpecs &attrSpecs, uint32_t docIdLimit);
+ const AttributesConfig &attrCfg, uint32_t docIdLimit);
~ParallelAttributeManager();
};
ParallelAttributeManager::ParallelAttributeManager(search::SerialNum configSerialNum, AttributeManager::SP baseAttrMgr,
- const AttributeSpecs &attrSpecs, uint32_t docIdLimit)
+ const AttributesConfig &attrCfg, uint32_t docIdLimit)
: documentMetaStoreInitTask(std::make_shared<DummyInitializerTask>()),
bucketDbOwner(std::make_shared<BucketDBOwner>()),
documentMetaStore(std::make_shared<DocumentMetaStore>(bucketDbOwner)),
@@ -239,7 +239,7 @@ ParallelAttributeManager::ParallelAttributeManager(search::SerialNum configSeria
fastAccessAttributesOnly(false),
mgr(std::make_shared<AttributeManager::SP>()),
initializer(std::make_shared<AttributeManagerInitializer>(configSerialNum, documentMetaStoreInitTask,
- documentMetaStore, baseAttrMgr, attrSpecs,
+ documentMetaStore, baseAttrMgr, attrCfg,
attributeGrow, attributeGrowNumDocs,
fastAccessAttributesOnly, mgr))
{
@@ -670,6 +670,16 @@ TEST_F("require that attributes can be initialized and loaded in sequence", Base
}
}
+AttributesConfigBuilder::Attribute
+createAttributeConfig(const vespalib::string &name)
+{
+ AttributesConfigBuilder::Attribute result;
+ result.name = name;
+ result.datatype = AttributesConfigBuilder::Attribute::Datatype::INT32;
+ result.collectiontype = AttributesConfigBuilder::Attribute::Collectiontype::SINGLE;
+ return result;
+}
+
TEST_F("require that attributes can be initialized and loaded in parallel", BaseFixture)
{
{
@@ -679,12 +689,12 @@ TEST_F("require that attributes can be initialized and loaded in parallel", Base
{
AttributeManagerFixture amf(f);
- AttributeSpecs attrSpecs;
- attrSpecs.emplace_back("a1", INT32_SINGLE);
- attrSpecs.emplace_back("a2", INT32_SINGLE);
- attrSpecs.emplace_back("a3", INT32_SINGLE);
+ AttributesConfigBuilder attrCfg;
+ attrCfg.attribute.push_back(createAttributeConfig("a1"));
+ attrCfg.attribute.push_back(createAttributeConfig("a2"));
+ attrCfg.attribute.push_back(createAttributeConfig("a3"));
- ParallelAttributeManager newMgr(createSerialNum + 5, amf._msp, attrSpecs, 10);
+ ParallelAttributeManager newMgr(createSerialNum + 5, amf._msp, attrCfg, 10);
AttributeGuard::UP a1 = newMgr.mgr->get()->getAttribute("a1");
TEST_DO(validateAttribute(*a1->get()));
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index 3eb69b045f9..114fd3b43bd 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -9,7 +9,6 @@ LOG_SETUP("attribute_test");
#include <vespa/document/update/arithmeticvalueupdate.h>
#include <vespa/searchcommon/attribute/attributecontent.h>
#include <vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h>
-#include <vespa/searchcore/proton/attribute/attribute_specs.h>
#include <vespa/searchcore/proton/attribute/attribute_writer.h>
#include <vespa/searchcore/proton/attribute/attributemanager.h>
#include <vespa/searchcore/proton/attribute/filter_attribute_manager.h>
@@ -449,23 +448,24 @@ TEST_F("require that attribute adapter handles predicate update", Fixture)
struct AttributeCollectionSpecFixture
{
- AttributeSpecs _specs;
+ AttributesConfigBuilder _builder;
AttributeCollectionSpecFactory _factory;
AttributeCollectionSpecFixture(bool fastAccessOnly)
- : _specs(),
+ : _builder(),
_factory(search::GrowStrategy(), 100, fastAccessOnly)
{
addAttribute("a1", false);
addAttribute("a2", true);
}
void addAttribute(const vespalib::string &name, bool fastAccess) {
- AVConfig cfg;
- cfg.setFastAccess(fastAccess);
- _specs.emplace_back(name, cfg);
+ AttributesConfigBuilder::Attribute attr;
+ attr.name = name;
+ attr.fastaccess = fastAccess;
+ _builder.attribute.push_back(attr);
}
AttributeCollectionSpec::UP create(uint32_t docIdLimit,
search::SerialNum serialNum) {
- return _factory.create(_specs, docIdLimit, serialNum);
+ return _factory.create(_builder, docIdLimit, serialNum);
}
};
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index 90532670e74..a1f5b606415 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -3,7 +3,6 @@
#include <vespa/config-attributes.h>
#include <vespa/config-imported-fields.h>
#include <vespa/config-rank-profiles.h>
-#include <vespa/searchcore/proton/attribute/attribute_specs.h>
#include <vespa/searchcore/proton/server/documentdbconfig.h>
#include <vespa/searchcore/proton/test/documentdb_config_builder.h>
#include <vespa/vespalib/testkit/testapp.h>
@@ -114,11 +113,4 @@ TEST_F("require that makeReplayConfig() drops unneeded configs", Fixture)
EXPECT_TRUE(DDBC::preferOriginalConfig(f.nullCfg).get() == nullptr);
}
-TEST_F("require that attribute spec is setup", Fixture)
-{
- const auto &attributeSpecs = f.fullCfg->getAttributeSpecs().getSpecs();
- EXPECT_EQUAL(1, attributeSpecs.size());
- EXPECT_EQUAL("my_attribute", attributeSpecs[0].getName());
-}
-
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
index d5c556c2db4..b9d8a55b302 100644
--- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
+++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
@@ -14,7 +14,6 @@
#include <vespa/searchcore/proton/server/proton_config_fetcher.h>
#include <vespa/searchcore/proton/server/proton_config_snapshot.h>
#include <vespa/searchcore/proton/server/i_proton_configurer.h>
-#include <vespa/searchcore/proton/attribute/attribute_specs.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/varholder.h>
@@ -250,22 +249,6 @@ TEST_FF("require that documentdb config manager builds schema with imported attr
EXPECT_EQUAL("imported", schema->getImportedAttributeFields()[0].getName());
}
-TEST_FF("require that documentdb config manager builds attribute specs",
- ConfigTestFixture("search"),
- DocumentDBConfigManager(f1.configId + "/typea", "typea"))
-{
- auto *docType = f1.addDocType("typea");
- docType->attributesBuilder.attribute.resize(1);
- docType->attributesBuilder.attribute[0].name = "attrname";
-
- ConfigRetriever retriever(f2.createConfigKeySet(), f1.context);
- f2.forwardConfig(f1.getBootstrapConfig(1));
- f2.update(retriever.getBootstrapConfigs()); // Cheating, but we only need the configs
- const auto &attrSpecs = f2.getConfig()->getAttributeSpecs().getSpecs();
- EXPECT_EQUAL(1u, attrSpecs.size());
- EXPECT_EQUAL("attrname", attrSpecs[0].getName());
-}
-
TEST_FFF("require that proton config fetcher follows changes to bootstrap",
ConfigTestFixture("search"),
ProtonConfigOwner(),
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 ab786d21e79..7a8247c8944 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,6 @@
#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_aspect_delayer.h>
using namespace config;
using namespace proton;
@@ -72,17 +71,14 @@ struct DBConfigFixture {
const vespalib::string &configId,
const vespalib::string &docTypeName)
{
- AttributeAspectDelayer attributeAspectDelayer;
- attributeAspectDelayer.setup(_attributesBuilder, _summarymapBuilder);
return std::make_shared<DocumentDBConfig>
(generation,
std::make_shared<RankProfilesConfig>(_rankProfilesBuilder),
buildRankingConstants(),
std::make_shared<IndexschemaConfig>(_indexschemaBuilder),
- attributeAspectDelayer.getAttributesConfig(),
- attributeAspectDelayer.getAttributeSpecs(),
+ std::make_shared<AttributesConfig>(_attributesBuilder),
std::make_shared<SummaryConfig>(_summaryBuilder),
- attributeAspectDelayer.getSummarymapConfig(),
+ std::make_shared<SummarymapConfig>(_summarymapBuilder),
std::make_shared<JuniperrcConfig>(_juniperrcBuilder),
documentTypes,
repo,
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.cpp
index e619d232f0c..b83680dc3f7 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.cpp
@@ -5,7 +5,6 @@
LOG_SETUP(".proton.attribute.attribute_collection_spec_factory");
#include "attribute_collection_spec_factory.h"
#include <vespa/searchlib/attribute/configconverter.h>
-#include "attribute_specs.h"
using search::attribute::ConfigConverter;
using search::GrowStrategy;
@@ -23,24 +22,24 @@ AttributeCollectionSpecFactory::AttributeCollectionSpecFactory(
}
AttributeCollectionSpec::UP
-AttributeCollectionSpecFactory::create(const AttributeSpecs &attrSpecs,
+AttributeCollectionSpecFactory::create(const AttributesConfig &attrCfg,
uint32_t docIdLimit,
search::SerialNum serialNum) const
{
AttributeCollectionSpec::AttributeList attrs;
// Amortize memory spike cost over N docs
- const size_t skew = _growNumDocs/(attrSpecs.getSpecs().size()+1);
+ const size_t skew = _growNumDocs/(attrCfg.attribute.size()+1);
GrowStrategy grow = _growStrategy;
grow.setDocsInitialCapacity(std::max(grow.getDocsInitialCapacity(),
docIdLimit));
- for (const auto &attr : attrSpecs.getSpecs()) {
- auto cfg = attr.getConfig();
+ for (const auto &attr : attrCfg.attribute) {
+ search::attribute::Config cfg = ConfigConverter::convert(attr);
if (_fastAccessOnly && !cfg.fastAccess()) {
continue;
}
grow.setDocsGrowDelta(grow.getDocsGrowDelta() + skew);
cfg.setGrowStrategy(grow);
- attrs.push_back(AttributeSpec(attr.getName(), cfg));
+ attrs.push_back(AttributeSpec(attr.name, cfg));
}
return AttributeCollectionSpec::UP(new AttributeCollectionSpec(attrs,
docIdLimit,
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h
index 23ae550478d..dc3dfcbd8d4 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h
@@ -6,11 +6,10 @@
#include <vespa/searchcommon/attribute/config.h>
#include <vespa/searchcommon/common/growstrategy.h>
#include <vespa/searchlib/common/serialnum.h>
+#include <vespa/config-attributes.h>
namespace proton {
-class AttributeSpecs;
-
/**
* A factory for generating an AttributeCollectionSpec based on AttributesConfig
* from the config server.
@@ -18,6 +17,8 @@ class AttributeSpecs;
class AttributeCollectionSpecFactory
{
private:
+ typedef vespa::config::search::AttributesConfig AttributesConfig;
+
const search::GrowStrategy _growStrategy;
const size_t _growNumDocs;
const bool _fastAccessOnly;
@@ -27,7 +28,7 @@ public:
size_t growNumDocs,
bool fastAccessOnly);
- AttributeCollectionSpec::UP create(const AttributeSpecs &attrSpecs,
+ AttributeCollectionSpec::UP create(const AttributesConfig &attrCfg,
uint32_t docIdLimit,
search::SerialNum serialNum) const;
};
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.cpp
index 640171a39b0..0570020e760 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.cpp
@@ -9,6 +9,7 @@
using search::AttributeVector;
using search::GrowStrategy;
using search::SerialNum;
+using vespa::config::search::AttributesConfig;
namespace proton {
@@ -89,14 +90,14 @@ AttributeManagerInitializer::createAttributeSpec() const
{
uint32_t docIdLimit = 1; // The real docIdLimit is used after attributes are loaded to pad them
AttributeCollectionSpecFactory factory(_attributeGrow, _attributeGrowNumDocs, _fastAccessAttributesOnly);
- return factory.create(_attrSpecs, docIdLimit, _configSerialNum);
+ return factory.create(_attrCfg, docIdLimit, _configSerialNum);
}
AttributeManagerInitializer::AttributeManagerInitializer(SerialNum configSerialNum,
initializer::InitializerTask::SP documentMetaStoreInitTask,
DocumentMetaStore::SP documentMetaStore,
AttributeManager::SP baseAttrMgr,
- const AttributeSpecs &attrSpecs,
+ const AttributesConfig &attrCfg,
const GrowStrategy &attributeGrow,
size_t attributeGrowNumDocs,
bool fastAccessAttributesOnly,
@@ -104,7 +105,7 @@ AttributeManagerInitializer::AttributeManagerInitializer(SerialNum configSerialN
: _configSerialNum(configSerialNum),
_documentMetaStore(documentMetaStore),
_attrMgr(),
- _attrSpecs(attrSpecs),
+ _attrCfg(attrCfg),
_attributeGrow(attributeGrow),
_attributeGrowNumDocs(attributeGrowNumDocs),
_fastAccessAttributesOnly(fastAccessAttributesOnly),
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.h
index 16bd5217774..9e1857d5f00 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_manager_initializer.h
@@ -8,7 +8,7 @@
#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/initializer/initializer_task.h>
#include <vespa/searchlib/common/serialnum.h>
-#include "attribute_specs.h"
+#include <vespa/config-attributes.h>
namespace proton {
@@ -21,7 +21,7 @@ private:
search::SerialNum _configSerialNum;
DocumentMetaStore::SP _documentMetaStore;
AttributeManager::SP _attrMgr;
- AttributeSpecs _attrSpecs;
+ vespa::config::search::AttributesConfig _attrCfg;
search::GrowStrategy _attributeGrow;
size_t _attributeGrowNumDocs;
bool _fastAccessAttributesOnly;
@@ -35,7 +35,7 @@ public:
initializer::InitializerTask::SP documentMetaStoreInitTask,
DocumentMetaStore::SP documentMetaStore,
AttributeManager::SP baseAttrMgr,
- const AttributeSpecs &attrSpecs,
+ const vespa::config::search::AttributesConfig &attrCfg,
const search::GrowStrategy &attributeGrow,
size_t attributeGrowNumDocs,
bool fastAccessAttributesOnly,
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
index 200402b5d82..dc1379ee316 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
@@ -9,7 +9,6 @@
#include <vespa/config-summarymap.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/document/config/config-documenttypes.h>
-#include <vespa/searchcore/proton/attribute/attribute_specs.h>
using namespace config;
using namespace vespa::config::search::summary;
@@ -46,7 +45,6 @@ DocumentDBConfig::DocumentDBConfig(
const RankingConstants::SP &rankingConstants,
const IndexschemaConfigSP &indexschema,
const AttributesConfigSP &attributes,
- const std::shared_ptr<const AttributeSpecs> &attributeSpecs,
const SummaryConfigSP &summary,
const SummarymapConfigSP &summarymap,
const JuniperrcConfigSP &juniperrc,
@@ -66,7 +64,6 @@ DocumentDBConfig::DocumentDBConfig(
_rankingConstants(rankingConstants),
_indexschema(indexschema),
_attributes(attributes),
- _attributeSpecs(attributeSpecs),
_summary(summary),
_summarymap(summarymap),
_juniperrc(juniperrc),
@@ -90,7 +87,6 @@ DocumentDBConfig(const DocumentDBConfig &cfg)
_rankingConstants(cfg._rankingConstants),
_indexschema(cfg._indexschema),
_attributes(cfg._attributes),
- _attributeSpecs(cfg._attributeSpecs),
_summary(cfg._summary),
_summarymap(cfg._summarymap),
_juniperrc(cfg._juniperrc),
@@ -117,8 +113,6 @@ DocumentDBConfig::operator==(const DocumentDBConfig & rhs) const
rhs._indexschema.get()) &&
equals<AttributesConfig>(_attributes.get(),
rhs._attributes.get()) &&
- equals<AttributeSpecs>(_attributeSpecs.get(),
- rhs._attributeSpecs.get()) &&
equals<SummaryConfig>(_summary.get(),
rhs._summary.get()) &&
equals<SummarymapConfig>(_summarymap.get(),
@@ -150,8 +144,7 @@ DocumentDBConfig::compare(const DocumentDBConfig &rhs) const
retval.indexschemaChanged =
!equals<IndexschemaConfig>(_indexschema.get(), rhs._indexschema.get());
retval.attributesChanged =
- !equals<AttributesConfig>(_attributes.get(), rhs._attributes.get()) ||
- !equals<AttributeSpecs>(_attributeSpecs.get(), rhs._attributeSpecs.get());
+ !equals<AttributesConfig>(_attributes.get(), rhs._attributes.get());
retval.summaryChanged =
!equals<SummaryConfig>(_summary.get(), rhs._summary.get());
retval.summarymapChanged =
@@ -183,7 +176,6 @@ DocumentDBConfig::valid() const
(_rankingConstants.get() != NULL) &&
(_indexschema.get() != NULL) &&
(_attributes.get() != NULL) &&
- _attributeSpecs &&
(_summary.get() != NULL) &&
(_summarymap.get() != NULL) &&
(_juniperrc.get() != NULL) &&
@@ -224,7 +216,6 @@ DocumentDBConfig::makeReplayConfig(const SP & orig)
std::make_shared<RankingConstants>(),
o._indexschema,
o._attributes,
- o._attributeSpecs,
o._summary,
std::make_shared<SummarymapConfig>(),
o._juniperrc,
@@ -257,8 +248,7 @@ DocumentDBConfig::preferOriginalConfig(const SP & self)
DocumentDBConfig::SP
-DocumentDBConfig::newFromAttributesConfig(const AttributesConfigSP &attributes,
- const std::shared_ptr<const AttributeSpecs> &attributeSpecs) const
+DocumentDBConfig::newFromAttributesConfig(const AttributesConfigSP &attributes) const
{
return std::make_shared<DocumentDBConfig>(
_generation,
@@ -266,7 +256,6 @@ DocumentDBConfig::newFromAttributesConfig(const AttributesConfigSP &attributes,
_rankingConstants,
_indexschema,
attributes,
- attributeSpecs,
_summary,
_summarymap,
_juniperrc,
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h
index 51de714ee30..b581655330d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h
@@ -31,8 +31,6 @@ namespace document { namespace internal { class InternalDocumenttypesType; } }
namespace proton {
-class AttributeSpecs;
-
class DocumentDBConfig
{
public:
@@ -84,7 +82,6 @@ private:
RankingConstants::SP _rankingConstants;
IndexschemaConfigSP _indexschema;
AttributesConfigSP _attributes;
- std::shared_ptr<const AttributeSpecs> _attributeSpecs;
SummaryConfigSP _summary;
SummarymapConfigSP _summarymap;
JuniperrcConfigSP _juniperrc;
@@ -112,7 +109,6 @@ public:
const RankingConstants::SP &rankingConstants,
const IndexschemaConfigSP &indexschema,
const AttributesConfigSP &attributes,
- const std::shared_ptr<const AttributeSpecs> &attributeSpecs,
const SummaryConfigSP &summary,
const SummarymapConfigSP &summarymap,
const JuniperrcConfigSP &juniperrc,
@@ -159,8 +155,6 @@ public:
const search::index::Schema::SP &getSchemaSP() const { return _schema; }
const MaintenanceConfigSP &getMaintenanceConfigSP() const { return _maintenance; }
const search::TuneFileDocumentDB::SP &getTuneFileDocumentDBSP() const { return _tuneFileDocumentDB; }
- const AttributeSpecs &getAttributeSpecs() const { return *_attributeSpecs; }
- const std::shared_ptr<const AttributeSpecs> &getAttributeSpecsSP() const { return _attributeSpecs; }
bool operator==(const DocumentDBConfig &rhs) const;
@@ -194,8 +188,7 @@ public:
/**
* Create modified attributes config.
*/
- SP newFromAttributesConfig(const AttributesConfigSP &attributes,
- const std::shared_ptr<const AttributeSpecs> &attributeSpecs) const;
+ SP newFromAttributesConfig(const AttributesConfigSP &attributes) const;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
index 6f27d511507..a258a282f81 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
@@ -12,7 +12,6 @@
#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_aspect_delayer.h>
LOG_SETUP(".proton.server.documentdbconfigmanager");
@@ -269,17 +268,14 @@ DocumentDBConfigManager::update(const ConfigSnapshot &snapshot)
newMaintenanceConfig = oldMaintenanceConfig;
}
ConfigSnapshot extraConfigs(snapshot.subset(_extraConfigKeys));
- AttributeAspectDelayer attributeAspectDelayer;
- attributeAspectDelayer.setup(*newAttributesConfig, *newSummarymapConfig);
DocumentDBConfig::SP newSnapshot(
new DocumentDBConfig(generation,
newRankProfilesConfig,
newRankingConstants,
newIndexschemaConfig,
- attributeAspectDelayer.getAttributesConfig(),
- attributeAspectDelayer.getAttributeSpecs(),
+ newAttributesConfig,
newSummaryConfig,
- attributeAspectDelayer.getSummarymapConfig(),
+ newSummarymapConfig,
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 2c3fc20128f..2ebadce7e38 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp
@@ -3,7 +3,6 @@
#include <vespa/fastos/fastos.h>
#include "documentdbconfigscout.h"
#include <vespa/searchcore/proton/attribute/attributesconfigscout.h>
-#include <vespa/searchcore/proton/attribute/attribute_aspect_delayer.h>
using vespa::config::search::AttributesConfig;
@@ -20,10 +19,7 @@ DocumentDBConfigScout::scout(const DocumentDBConfig::SP &config,
ac(acScout.adjust(config->getAttributesConfig()));
if (*ac == config->getAttributesConfig())
return config; // no change
- AttributeAspectDelayer attributeAspectDelayer;
- attributeAspectDelayer.setup(*ac, config->getSummarymapConfig());
- return config->newFromAttributesConfig(attributeAspectDelayer.getAttributesConfig(),
- attributeAspectDelayer.getAttributeSpecs());
+ return config->newFromAttributesConfig(ac);
}
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 0337673b9da..e51ceebdbce 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
@@ -78,7 +78,7 @@ FastAccessDocSubDB::createAttributeManagerInitializer(const DocumentDBConfig &co
documentMetaStoreInitTask,
documentMetaStore,
baseAttrMgr,
- (_hasAttributes ? configSnapshot.getAttributeSpecs() : AttributeSpecs()),
+ (_hasAttributes ? configSnapshot.getAttributesConfig() : AttributesConfig()),
_attributeGrow,
_attributeGrowNumDocs,
_fastAccessAttributesOnly,
@@ -103,13 +103,13 @@ FastAccessDocSubDB::setupAttributeManager(AttributeManager::SP attrMgrResult)
AttributeCollectionSpec::UP
-FastAccessDocSubDB::createAttributeSpec(const AttributeSpecs &attrSpecs,
+FastAccessDocSubDB::createAttributeSpec(const AttributesConfig &attrCfg,
SerialNum serialNum) const
{
uint32_t docIdLimit(_dms->getCommittedDocIdLimit());
AttributeCollectionSpecFactory factory(_attributeGrow,
_attributeGrowNumDocs, _fastAccessAttributesOnly);
- return factory.create(attrSpecs, docIdLimit, serialNum);
+ return factory.create(attrCfg, docIdLimit, serialNum);
}
void
@@ -268,7 +268,7 @@ FastAccessDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot,
std::make_unique<AttributeWriterFactory>(), getSubDbName());
proton::IAttributeManager::SP oldMgr = extractAttributeManager(_fastAccessFeedView.get());
AttributeCollectionSpec::UP attrSpec =
- createAttributeSpec(newConfigSnapshot.getAttributeSpecs(), serialNum);
+ createAttributeSpec(newConfigSnapshot.getAttributesConfig(), serialNum);
IReprocessingInitializer::UP initializer =
configurer.reconfigure(newConfigSnapshot, oldConfigSnapshot, *attrSpec);
if (initializer->hasReprocessors()) {
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 4fff4be5a75..cd35d9204b1 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
@@ -87,7 +87,7 @@ protected:
MetricsWireService &_metricsWireService;
DocIdLimit _docIdLimit;
- AttributeCollectionSpec::UP createAttributeSpec(const AttributeSpecs &attrCfg, SerialNum serialNum) const;
+ AttributeCollectionSpec::UP createAttributeSpec(const AttributesConfig &attrCfg, SerialNum serialNum) const;
AttributeManager::SP getAndResetInitAttributeManager();
virtual IFlushTargetList getFlushTargetsInternal() override;
void reconfigureAttributeMetrics(const IAttributeManager &newMgr, const IAttributeManager &oldMgr);
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
index aedd0678ae0..6c3de875e22 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
@@ -175,7 +175,7 @@ SearchableDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot,
if (params.shouldAttributeManagerChange()) {
proton::IAttributeManager::SP oldMgr = getAttributeManager();
AttributeCollectionSpec::UP attrSpec =
- createAttributeSpec(newConfigSnapshot.getAttributeSpecs(), serialNum);
+ createAttributeSpec(newConfigSnapshot.getAttributesConfig(), serialNum);
IReprocessingInitializer::UP initializer =
_configurer.reconfigure(newConfigSnapshot, oldConfigSnapshot, *attrSpec, params, resolver);
if (initializer.get() != nullptr && initializer->hasReprocessors()) {
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 dd20ce44f46..14ed502cdc1 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,6 @@
#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_aspect_delayer.h>
using document::DocumenttypesConfig;
using search::TuneFileDocumentDB;
@@ -74,17 +73,14 @@ DocumentDBConfigBuilder::DocumentDBConfigBuilder(const DocumentDBConfig &cfg)
DocumentDBConfig::SP
DocumentDBConfigBuilder::build()
{
- AttributeAspectDelayer attributeAspectDelayer;
- attributeAspectDelayer.setup(*_attributes, *_summarymap);
return std::make_shared<DocumentDBConfig>(
_generation,
_rankProfiles,
_rankingConstants,
_indexschema,
- attributeAspectDelayer.getAttributesConfig(),
- attributeAspectDelayer.getAttributeSpecs(),
+ _attributes,
_summary,
- attributeAspectDelayer.getSummarymapConfig(),
+ _summarymap,
_juniperrc,
_documenttypes,
_repo,