summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp1
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp4
-rw-r--r--searchcore/src/tests/proton/server/memoryconfigstore_test.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp14
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp43
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h39
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h25
15 files changed, 100 insertions, 55 deletions
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp
index 03af3191f2b..f8eef6ed332 100644
--- a/searchcore/src/apps/tests/persistenceconformance_test.cpp
+++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp
@@ -111,6 +111,7 @@ public:
1,
std::make_shared<RankProfilesConfig>(),
std::make_shared<RankingConstantsConfig>(),
+ std::make_shared<matching::RankingConstants>(),
indexschema,
attributes,
summary,
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index a50a112aecc..c2f977c733a 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -321,6 +321,7 @@ createConfig()
0,
std::make_shared<RankProfilesConfig>(),
std::make_shared<RankingConstantsConfig>(),
+ std::make_shared<matching::RankingConstants>(),
std::make_shared<IndexschemaConfig>(),
std::make_shared<AttributesConfig>(),
std::make_shared<SummaryConfig>(),
@@ -341,6 +342,7 @@ createConfig(const Schema::SP &schema)
0,
std::make_shared<RankProfilesConfig>(),
std::make_shared<RankingConstantsConfig>(),
+ std::make_shared<matching::RankingConstants>(),
std::make_shared<IndexschemaConfig>(),
std::make_shared<AttributesConfig>(),
std::make_shared<SummaryConfig>(),
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
index 831c5d522d9..5cced5038c8 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfig/documentdbconfig_test.cpp
@@ -30,6 +30,7 @@ getConfig(int64_t generation, const Schema::SP &schema,
generation,
make_shared<RankProfilesConfig>(rankProfiles),
make_shared<RankingConstantsConfig>(),
+ make_shared<matching::RankingConstants>(),
make_shared<IndexschemaConfig>(),
make_shared<AttributesConfig>(),
make_shared<SummaryConfig>(),
diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
index bb0a3e33b50..57b77c5a0a5 100644
--- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp
@@ -31,6 +31,7 @@ getConfig(int64_t generation, const Schema::SP &schema,
generation,
make_shared<RankProfilesConfig>(),
make_shared<RankingConstantsConfig>(),
+ make_shared<matching::RankingConstants>(),
make_shared<IndexschemaConfig>(),
make_shared<AttributesConfig>(attributes),
make_shared<SummaryConfig>(),
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
index ec47b3c3705..a0443d6c8e4 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
@@ -5,10 +5,8 @@ LOG_SETUP("fileconfigmanager_test");
#include "config-mycfg.h"
#include <vespa/searchcore/proton/server/fileconfigmanager.h>
-#include <vespa/searchcore/proton/server/documentdbconfigmanager.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/closure.h>
#include <vespa/searchcore/proton/common/schemautil.h>
using namespace config;
@@ -36,6 +34,7 @@ getConfig(int64_t generation, const Schema::SP &schema)
generation,
std::make_shared<vespa::config::search::RankProfilesConfig>(),
std::make_shared<vespa::config::search::core::RankingConstantsConfig>(),
+ std::make_shared<matching::RankingConstants>(),
std::make_shared<vespa::config::search::IndexschemaConfig>(),
std::make_shared<vespa::config::search::AttributesConfig>(),
std::make_shared<vespa::config::search::SummaryConfig>(),
@@ -110,6 +109,7 @@ makeEmptyConfigSnapshot(void)
0,
DocumentDBConfig::RankProfilesConfigSP(),
DocumentDBConfig::RankingConstantsConfigSP(),
+ DocumentDBConfig::RankingConstants::SP(),
DocumentDBConfig::IndexschemaConfigSP(),
DocumentDBConfig::AttributesConfigSP(),
DocumentDBConfig::SummaryConfigSP(),
diff --git a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
index f1cbd012ab5..1156da37aa1 100644
--- a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
+++ b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
@@ -25,6 +25,7 @@ getConfig(int64_t generation, const Schema::SP &schema)
generation,
DocumentDBConfig::RankProfilesConfigSP(),
DocumentDBConfig::RankingConstantsConfigSP(),
+ DocumentDBConfig::RankingConstants::SP(),
DocumentDBConfig::IndexschemaConfigSP(),
DocumentDBConfig::AttributesConfigSP(),
DocumentDBConfig::SummaryConfigSP(),
diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp
index d11bcad79f7..6c3e6cbad80 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.cpp
@@ -15,6 +15,14 @@ RankingConstants::Constant::Constant(const vespalib::string &name_in,
{
}
+bool
+RankingConstants::Constant::operator==(const Constant &rhs) const
+{
+ return name == rhs.name &&
+ type == rhs.type &&
+ filePath == rhs.filePath;
+}
+
RankingConstants::RankingConstants()
: _constants()
{
@@ -28,6 +36,12 @@ RankingConstants::RankingConstants(const Vector &constants)
}
}
+bool
+RankingConstants::operator==(const RankingConstants &rhs) const
+{
+ return _constants == rhs._constants;
+}
+
const RankingConstants::Constant *
RankingConstants::getConstant(const vespalib::string &name) const
{
diff --git a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h
index 8f2a7c62f5d..5e70af94a7a 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/ranking_constants.h
@@ -22,6 +22,7 @@ public:
Constant(const vespalib::string &name_in,
const vespalib::string &type_in,
const vespalib::string &filePath_in);
+ bool operator==(const Constant &rhs) const;
};
using Vector = std::vector<Constant>;
@@ -31,8 +32,10 @@ private:
Map _constants;
public:
+ using SP = std::shared_ptr<RankingConstants>;
RankingConstants();
RankingConstants(const Vector &constants);
+ bool operator==(const RankingConstants &rhs) const;
const Constant *getConstant(const vespalib::string &name) const;
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
index 91e30ebebe2..a1962b361d4 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.cpp
@@ -18,6 +18,7 @@ namespace proton {
DocumentDBConfig::ComparisonResult::ComparisonResult()
: rankProfilesChanged(false),
+ rankingConstantsCfgChanged(false),
rankingConstantsChanged(false),
indexschemaChanged(false),
attributesChanged(false),
@@ -35,7 +36,8 @@ DocumentDBConfig::ComparisonResult::ComparisonResult()
DocumentDBConfig::DocumentDBConfig(
int64_t generation,
const RankProfilesConfigSP &rankProfiles,
- const RankingConstantsConfigSP &rankingConstants,
+ const RankingConstantsConfigSP &rankingConstantsCfg,
+ const RankingConstants::SP &rankingConstants,
const IndexschemaConfigSP &indexschema,
const AttributesConfigSP &attributes,
const SummaryConfigSP &summary,
@@ -53,6 +55,7 @@ DocumentDBConfig::DocumentDBConfig(
_docTypeName(docTypeName),
_generation(generation),
_rankProfiles(rankProfiles),
+ _rankingConstantsCfg(rankingConstantsCfg),
_rankingConstants(rankingConstants),
_indexschema(indexschema),
_attributes(attributes),
@@ -76,6 +79,7 @@ DocumentDBConfig(const DocumentDBConfig &cfg)
_docTypeName(cfg._docTypeName),
_generation(cfg._generation),
_rankProfiles(cfg._rankProfiles),
+ _rankingConstantsCfg(cfg._rankingConstantsCfg),
_rankingConstants(cfg._rankingConstants),
_indexschema(cfg._indexschema),
_attributes(cfg._attributes),
@@ -97,8 +101,10 @@ DocumentDBConfig::operator==(const DocumentDBConfig & rhs) const
{
return equals<RankProfilesConfig>(_rankProfiles.get(),
rhs._rankProfiles.get()) &&
- equals<RankingConstantsConfig>(_rankingConstants.get(),
- rhs._rankingConstants.get()) &&
+ equals<RankingConstantsConfig>(_rankingConstantsCfg.get(),
+ rhs._rankingConstantsCfg.get()) &&
+ equals<RankingConstants>(_rankingConstants.get(),
+ rhs._rankingConstants.get()) &&
equals<IndexschemaConfig>(_indexschema.get(),
rhs._indexschema.get()) &&
equals<AttributesConfig>(_attributes.get(),
@@ -127,8 +133,10 @@ DocumentDBConfig::compare(const DocumentDBConfig &rhs) const
ComparisonResult retval;
retval.rankProfilesChanged =
!equals<RankProfilesConfig>(_rankProfiles.get(), rhs._rankProfiles.get());
+ retval.rankingConstantsCfgChanged =
+ !equals<RankingConstantsConfig>(_rankingConstantsCfg.get(), rhs._rankingConstantsCfg.get());
retval.rankingConstantsChanged =
- !equals<RankingConstantsConfig>(_rankingConstants.get(), rhs._rankingConstants.get());
+ !equals<RankingConstants>(_rankingConstants.get(), rhs._rankingConstants.get());
retval.indexschemaChanged =
!equals<IndexschemaConfig>(_indexschema.get(), rhs._indexschema.get());
retval.attributesChanged =
@@ -159,17 +167,18 @@ bool
DocumentDBConfig::valid(void) const
{
return _rankProfiles.get() != NULL &&
- _rankingConstants.get() != NULL &&
- _indexschema.get() != NULL &&
- _attributes.get() != NULL &&
- _summary.get() != NULL &&
- _summarymap.get() != NULL &&
- _juniperrc.get() != NULL &&
- _documenttypes.get() != NULL &&
- _repo.get() != NULL &&
- _tuneFileDocumentDB.get() != NULL &&
- _schema.get() != NULL &&
- _maintenance.get() != NULL;
+ _rankingConstantsCfg.get() != NULL &&
+ _rankingConstants.get() != NULL &&
+ _indexschema.get() != NULL &&
+ _attributes.get() != NULL &&
+ _summary.get() != NULL &&
+ _summarymap.get() != NULL &&
+ _juniperrc.get() != NULL &&
+ _documenttypes.get() != NULL &&
+ _repo.get() != NULL &&
+ _tuneFileDocumentDB.get() != NULL &&
+ _schema.get() != NULL &&
+ _maintenance.get() != NULL;
}
namespace
@@ -198,7 +207,8 @@ DocumentDBConfig::makeReplayConfig(const SP & orig)
SP ret = std::make_shared<DocumentDBConfig>(
o._generation,
emptyConfig(o._rankProfiles),
- emptyConfig(o._rankingConstants),
+ emptyConfig(o._rankingConstantsCfg),
+ std::make_shared<RankingConstants>(),
o._indexschema,
o._attributes,
o._summary,
@@ -237,6 +247,7 @@ DocumentDBConfig::newFromAttributesConfig(const AttributesConfigSP &attributes)
return std::make_shared<DocumentDBConfig>(
_generation,
_rankProfiles,
+ _rankingConstantsCfg,
_rankingConstants,
_indexschema,
attributes,
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h
index 5c0e12ae964..3cc3b1fb44f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfig.h
@@ -8,6 +8,8 @@
#include <vespa/searchlib/common/tunefileinfo.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/searchcommon/common/schema.h>
+#include <vespa/searchcore/config/config-ranking-constants.h>
+#include <vespa/searchcore/proton/matching/ranking_constants.h>
#include <vespa/config-attributes.h>
#include <vespa/config-indexschema.h>
#include <vespa/config-rank-profiles.h>
@@ -15,7 +17,6 @@
#include <vespa/config-summarymap.h>
#include <vespa/config/retriever/configkeyset.h>
#include <vespa/config/retriever/configsnapshot.h>
-#include <vespa/searchcore/config/config-ranking-constants.h>
namespace proton {
@@ -26,6 +27,7 @@ public:
{
public:
bool rankProfilesChanged;
+ bool rankingConstantsCfgChanged;
bool rankingConstantsChanged;
bool indexschemaChanged;
bool attributesChanged;
@@ -41,23 +43,25 @@ public:
ComparisonResult();
};
- typedef std::shared_ptr<DocumentDBConfig> SP;
- typedef std::shared_ptr<vespa::config::search::IndexschemaConfig> IndexschemaConfigSP;
- typedef std::shared_ptr<vespa::config::search::AttributesConfig> AttributesConfigSP;
- typedef std::shared_ptr<vespa::config::search::RankProfilesConfig> RankProfilesConfigSP;
- typedef std::shared_ptr<vespa::config::search::core::RankingConstantsConfig> RankingConstantsConfigSP;
- typedef std::shared_ptr<vespa::config::search::SummaryConfig> SummaryConfigSP;
- typedef std::shared_ptr<vespa::config::search::SummarymapConfig> SummarymapConfigSP;
- typedef std::shared_ptr<vespa::config::search::summary::JuniperrcConfig> JuniperrcConfigSP;
- typedef std::shared_ptr<document::DocumenttypesConfig> DocumenttypesConfigSP;
- typedef DocumentDBMaintenanceConfig::SP MaintenanceConfigSP;
+ using SP = std::shared_ptr<DocumentDBConfig>;
+ using IndexschemaConfigSP = std::shared_ptr<vespa::config::search::IndexschemaConfig>;
+ using AttributesConfigSP = std::shared_ptr<vespa::config::search::AttributesConfig>;
+ using RankProfilesConfigSP = std::shared_ptr<vespa::config::search::RankProfilesConfig>;
+ using RankingConstantsConfigSP = std::shared_ptr<vespa::config::search::core::RankingConstantsConfig>;
+ using RankingConstants = matching::RankingConstants;
+ using SummaryConfigSP = std::shared_ptr<vespa::config::search::SummaryConfig>;
+ using SummarymapConfigSP = std::shared_ptr<vespa::config::search::SummarymapConfig>;
+ using JuniperrcConfigSP = std::shared_ptr<vespa::config::search::summary::JuniperrcConfig>;
+ using DocumenttypesConfigSP = std::shared_ptr<document::DocumenttypesConfig>;
+ using MaintenanceConfigSP = DocumentDBMaintenanceConfig::SP;
private:
vespalib::string _configId;
vespalib::string _docTypeName;
int64_t _generation;
RankProfilesConfigSP _rankProfiles;
- RankingConstantsConfigSP _rankingConstants;
+ RankingConstantsConfigSP _rankingConstantsCfg;
+ RankingConstants::SP _rankingConstants;
IndexschemaConfigSP _indexschema;
AttributesConfigSP _attributes;
SummaryConfigSP _summary;
@@ -82,7 +86,8 @@ private:
public:
DocumentDBConfig(int64_t generation,
const RankProfilesConfigSP &rankProfiles,
- const RankingConstantsConfigSP &rankingConstants,
+ const RankingConstantsConfigSP &rankingConstantsCfg,
+ const RankingConstants::SP &rankingConstants,
const IndexschemaConfigSP &indexschema,
const AttributesConfigSP &attributes,
const SummaryConfigSP &summary,
@@ -110,7 +115,9 @@ public:
getRankProfilesConfig() const { return *_rankProfiles; }
const vespa::config::search::core::RankingConstantsConfig &
- getRankingConstantsConfig() const { return *_rankingConstants; }
+ getRankingConstantsConfig() const { return *_rankingConstantsCfg; }
+
+ const RankingConstants &getRankingConstants() const { return *_rankingConstants; }
const vespa::config::search::IndexschemaConfig &
getIndexschemaConfig() const { return *_indexschema; }
@@ -134,7 +141,9 @@ public:
getRankProfilesConfigSP(void) const { return _rankProfiles; }
const RankingConstantsConfigSP &
- getRankingConstantsConfigSP() const { return _rankingConstants; }
+ getRankingConstantsConfigSP() const { return _rankingConstantsCfg; }
+
+ const RankingConstants::SP &getRankingConstantsSP() const { return _rankingConstants; }
const IndexschemaConfigSP &
getIndexschemaConfigSP(void) const { return _indexschema; }
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
index a960fb05fb4..fea35c9ac25 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
@@ -15,10 +15,11 @@ using namespace vespa::config::search::summary;
using namespace vespa::config::search;
using document::DocumentTypeRepo;
+using fastos::TimeStamp;
using search::TuneFileDocumentDB;
using search::index::Schema;
using search::index::SchemaBuilder;
-using fastos::TimeStamp;
+using proton::matching::RankingConstants;
namespace proton {
@@ -136,6 +137,7 @@ DocumentDBConfigManager::update(const ConfigSnapshot & snapshot)
DocumentDBConfig::SP current = _pendingConfigSnapshot;
RankProfilesConfigSP newRankProfilesConfig;
RankingConstantsConfigSP newRankingConstantsConfig;
+ matching::RankingConstants::SP newRankingConstants = std::make_shared<matching::RankingConstants>();
IndexschemaConfigSP newIndexschemaConfig;
AttributesConfigSP newAttributesConfig;
SummaryConfigSP newSummaryConfig;
@@ -184,14 +186,17 @@ DocumentDBConfigManager::update(const ConfigSnapshot & snapshot)
newRankingConstantsConfig = RankingConstantsConfigSP(
snapshot.getConfig<RankingConstantsConfig>(_configId));
const vespalib::string &spec = _bootstrapConfig->getFiledistributorrpcConfig().connectionspec;
+ RankingConstants::Vector constants;
if (spec != "") {
config::RpcFileAcquirer fileAcquirer(spec);
for (const RankingConstantsConfig::Constant &rc : newRankingConstantsConfig->constant) {
vespalib::string filePath = fileAcquirer.wait_for(rc.fileref, 5*60);
- LOG(info, "GOT file-acq PATH is: %s (ref %s for name %s type %s)\n",
- filePath.c_str(), rc.fileref.c_str(), rc.name.c_str(), rc.type.c_str());
+ LOG(info, "GOT file path from file acquirer: '%s' (name='%s', type='%s', ref='%s')\n",
+ filePath.c_str(), rc.name.c_str(), rc.type.c_str(), rc.fileref.c_str());
+ constants.emplace_back(rc.name, rc.type, filePath);
}
}
+ newRankingConstants = std::make_shared<RankingConstants>(constants);
}
if (snapshot.isChanged<IndexschemaConfig>(_configId, currentGeneration)) {
std::unique_ptr<IndexschemaConfig> indexschemaConfig =
@@ -238,6 +243,7 @@ DocumentDBConfigManager::update(const ConfigSnapshot & snapshot)
new DocumentDBConfig(generation,
newRankProfilesConfig,
newRankingConstantsConfig,
+ newRankingConstants,
newIndexschemaConfig,
newAttributesConfig,
newSummaryConfig,
diff --git a/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp b/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp
index 143d1439f82..17bc1a47ce3 100644
--- a/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/reconfig_params.cpp
@@ -22,7 +22,7 @@ ReconfigParams::shouldSchemaChange() const
bool
ReconfigParams::shouldMatchersChange() const
{
- return _res.rankProfilesChanged || _res.rankingConstantsChanged || shouldSchemaChange();
+ return _res.rankProfilesChanged || _res.rankingConstantsCfgChanged || _res.rankingConstantsChanged || shouldSchemaChange();
}
bool
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp
index 1fcdb40d901..dcb91d6ab71 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp
@@ -194,6 +194,7 @@ SearchableDocSubDBConfigurer::reconfigure(const DocumentDBConfig &newConfig,
SearchView::SP searchView = _searchView.get();
Matchers::SP matchers = searchView->getMatchers();
if (params.shouldMatchersChange()) {
+ _constantValueRepo.reconfigure(newConfig.getRankingConstants());
Matchers::SP newMatchers(
createMatchers(newConfig.getSchemaSP(),
newConfig.getRankProfilesConfig()).
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
index 081a89c944a..1ed13757aac 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
@@ -16,6 +16,7 @@ LOG_SETUP(".proton.server.searchabledocsubdb");
#include <vespa/searchlib/common/indexmetainfo.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/closuretask.h>
+#include <vespa/vespalib/tensor/default_tensor_engine.h>
using vespa::config::search::AttributesConfig;
using vespa::config::search::RankProfilesConfig;
@@ -47,8 +48,8 @@ SearchableDocSubDB::SearchableDocSubDB(const Config &cfg,
_indexWriter(),
_rSearchView(),
_rFeedView(),
- _constantValueFactory(),
- _constantValueRepo(_constantValueFactory),
+ _tensorLoader(vespalib::tensor::DefaultTensorEngine::ref()),
+ _constantValueRepo(_tensorLoader),
_configurer(_iSummaryMgr, _rSearchView, _rFeedView, ctx._queryLimiter, _constantValueRepo, ctx._clock,
getSubDbName(), ctx._fastUpdCtx._storeOnlyCtx._owner.getDistributionKey()),
_numSearcherThreads(cfg._numSearcherThreads),
@@ -210,6 +211,7 @@ SearchableDocSubDB::initViews(const DocumentDBConfig &configSnapshot,
AttributeManager::SP attrMgr = getAndResetInitAttributeManager();
const Schema::SP &schema = configSnapshot.getSchemaSP();
const IIndexManager::SP &indexMgr = getIndexManager();
+ _constantValueRepo.reconfigure(configSnapshot.getRankingConstants());
Matchers::SP matchers(_configurer.
createMatchers(schema,
configSnapshot.getRankProfilesConfig()).
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
index 34e9076b744..8f83e0e7552 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
@@ -19,9 +19,8 @@
#include <vespa/searchcore/proton/index/i_index_writer.h>
#include <vespa/searchcore/proton/index/indexmanager.h>
#include <vespa/searchcore/proton/matching/constant_value_repo.h>
-#include <vespa/searchcore/proton/matching/error_constant_value.h>
#include <vespa/searchcore/config/config-proton.h>
-#include <vespa/vespalib/eval/value_cache/constant_value.h>
+#include <vespa/vespalib/eval/value_cache/constant_tensor_loader.h>
#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
#include <vespa/vespalib/util/varholder.h>
@@ -75,23 +74,17 @@ public:
};
private:
- struct EmptyConstantValueFactory : public vespalib::eval::ConstantValueFactory {
- virtual vespalib::eval::ConstantValue::UP create(const vespalib::string &, const vespalib::string &) const override {
- return std::make_unique<matching::ErrorConstantValue>();
- }
- };
-
typedef FastAccessDocSubDB Parent;
- IIndexManager::SP _indexMgr;
- IIndexWriter::SP _indexWriter;
- vespalib::VarHolder<SearchView::SP> _rSearchView;
- vespalib::VarHolder<SearchableFeedView::SP> _rFeedView;
- EmptyConstantValueFactory _constantValueFactory;
- matching::ConstantValueRepo _constantValueRepo;
+ IIndexManager::SP _indexMgr;
+ IIndexWriter::SP _indexWriter;
+ vespalib::VarHolder<SearchView::SP> _rSearchView;
+ vespalib::VarHolder<SearchableFeedView::SP> _rFeedView;
+ vespalib::eval::ConstantTensorLoader _tensorLoader;
+ matching::ConstantValueRepo _constantValueRepo;
SearchableDocSubDBConfigurer _configurer;
- const size_t _numSearcherThreads;
- vespalib::ThreadExecutor &_warmupExecutor;
+ const size_t _numSearcherThreads;
+ vespalib::ThreadExecutor &_warmupExecutor;
// Note: lifetime of indexManager must be handled by caller.
initializer::InitializerTask::SP