diff options
Diffstat (limited to 'searchcore')
28 files changed, 101 insertions, 170 deletions
diff --git a/searchcore/src/apps/fdispatch/fdispatch.cpp b/searchcore/src/apps/fdispatch/fdispatch.cpp index 49bb978cf35..efca70b2b6a 100644 --- a/searchcore/src/apps/fdispatch/fdispatch.cpp +++ b/searchcore/src/apps/fdispatch/fdispatch.cpp @@ -9,6 +9,7 @@ #include <vespa/searchlib/aggregation/forcelink.hpp> #include <vespa/vespalib/util/signalhandler.h> #include <vespa/fastos/app.h> +#include <thread> #include <vespa/log/log.h> LOG_SETUP("fdispatch"); diff --git a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp index 33832dc98d0..bb26c0d88ec 100644 --- a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp +++ b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp @@ -18,6 +18,7 @@ #include <vespa/vespalib/util/slaveproc.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/objects/nbostream.h> +#include <vespa/config/helper/configgetter.hpp> #include <iostream> diff --git a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp index ae00e168c3d..e0102c8e059 100644 --- a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp +++ b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp @@ -1,5 +1,5 @@ // Copyright 2016 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/config/helper/configgetter.h> #include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/fieldvalue/document.h> @@ -10,6 +10,9 @@ #include <vespa/vespalib/util/programoptions.h> #include <vespa/document/config/config-documenttypes.h> #include <iostream> +#include <vespa/config/helper/configgetter.hpp> +#include <vespa/fastos/app.h> + #include <vespa/log/log.h> LOG_SETUP("vespa-transactionlog-inspect"); diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index a5cac711d39..a0b947e11f8 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -25,6 +25,8 @@ #include <vespa/searchlib/tensor/tensor_attribute.h> #include <vespa/searchcore/proton/common/hw_info.h> #include <vespa/vespalib/data/slime/slime.h> +#include <vespa/config/helper/configgetter.hpp> + #include <vespa/log/log.h> LOG_SETUP("docsummary_test"); diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 6d85baf0770..e948bb518d3 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("configurer_test"); #include <vespa/vespalib/testkit/testapp.h> #include <vespa/searchcore/proton/attribute/attribute_writer.h> @@ -20,11 +18,11 @@ LOG_SETUP("configurer_test"); #include <vespa/searchcore/proton/server/executorthreadingservice.h> #include <vespa/searchcore/proton/server/fast_access_doc_subdb_configurer.h> #include <vespa/searchcore/proton/server/summaryadapter.h> +#include <vespa/searchcore/proton/server/reconfig_params.h> #include <vespa/searchcore/proton/test/documentdb_config_builder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/nosyncproxy.h> #include <vespa/vespalib/io/fileutil.h> -#include <vespa/searchcore/proton/common/hw_info.h> using namespace config; using namespace document; diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index 88561b529bc..b483b4ea8f5 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -1,5 +1,5 @@ // Copyright 2016 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/vespalib/testkit/testapp.h> #include <vespa/document/base/globalid.h> @@ -308,7 +308,7 @@ struct MyWorld { owned_objects.search_handler.reset(new MySearchHandler(matcher)); owned_objects.context.reset(new MatchContext( IAttributeContext::UP(new MyAttributeContext), - ISearchContext::UP(new FakeSearchContext))); + matching::ISearchContext::UP(new FakeSearchContext))); vespalib::SimpleThreadBundle threadBundle(threads); SearchReply::UP reply = matcher->match(*req, threadBundle, searchContext, attributeContext, diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp index 05bf79cf1a2..3be1834a360 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp @@ -7,8 +7,10 @@ #include <vespa/searchcore/fdispatch/search/querycacheutil.h> #include <vespa/searchcore/fdispatch/search/nodemanager.h> #include <vespa/vespalib/util/exceptions.h> +#include <vespa/config/helper/configgetter.hpp> #include "engineadapter.h" #include "rpc.h" +#include <thread> #include <vespa/log/log.h> LOG_SETUP(".fdispatch"); diff --git a/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.cpp b/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.cpp index 702a77bbebe..00732fcedde 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.cpp @@ -1,11 +1,11 @@ // Copyright 2016 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(".proton.attribute.document_field_populator"); #include "document_field_populator.h" #include "document_field_retriever.h" #include <vespa/searchcore/proton/common/eventlogger.h> +#include <vespa/searchlib/attribute/attributevector.h> +#include <vespa/log/log.h> +LOG_SETUP(".proton.attribute.document_field_populator"); using document::Document; using search::index::Schema; @@ -25,7 +25,7 @@ getFieldName(const vespalib::string &subDbName, } DocumentFieldPopulator::DocumentFieldPopulator(const Schema::AttributeField &field, - search::AttributeVector::SP attr, + AttributeVectorSP attr, const vespalib::string &subDbName) : _field(field), _attr(attr), diff --git a/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.h b/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.h index a16401b775e..dcb543f84eb 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/document_field_populator.h @@ -14,14 +14,15 @@ namespace proton { class DocumentFieldPopulator : public IReprocessingRewriter { private: + using AttributeVectorSP = std::shared_ptr<search::AttributeVector>; search::index::Schema::AttributeField _field; - search::AttributeVector::SP _attr; + AttributeVectorSP _attr; vespalib::string _subDbName; int64_t _documentsPopulated; public: DocumentFieldPopulator(const search::index::Schema::AttributeField &field, - search::AttributeVector::SP attr, + AttributeVectorSP attr, const vespalib::string &subDbName); ~DocumentFieldPopulator(); diff --git a/searchcore/src/vespa/searchcore/proton/common/selectcontext.cpp b/searchcore/src/vespa/searchcore/proton/common/selectcontext.cpp index 5e15f6f65ea..36fa242daec 100644 --- a/searchcore/src/vespa/searchcore/proton/common/selectcontext.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/selectcontext.cpp @@ -32,7 +32,7 @@ void SelectContext::getAttributeGuards(void) { _guards->resize(_cachedSelect._attributes.size()); - std::vector<AttributeVector::SP>::const_iterator j(_cachedSelect._attributes.begin()); + auto j(_cachedSelect._attributes.begin()); for (std::vector<AttributeGuard>::iterator i(_guards->begin()), ie(_guards->end()); i != ie; ++i, ++j) { *i = AttributeGuard(*j); } diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.h b/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.h index fc7b38a25ff..2d011adfbc0 100644 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.h +++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/persistenceengine.h @@ -7,7 +7,7 @@ #include <vespa/searchcore/proton/common/handlermap.hpp> #include <vespa/searchcore/proton/persistenceengine/ipersistencehandler.h> #include <vespa/vespalib/util/sync.h> -#include <vespa/vespalib/util/sync.h> +#include <vespa/vespalib/util/rwlock.h> namespace proton { diff --git a/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.cpp b/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.cpp index 8e402c7e3b9..14e29a2650c 100644 --- a/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.cpp @@ -1,9 +1,7 @@ // Copyright 2016 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(".proton.server.docstorevalidator"); #include "docstorevalidator.h" +#include <vespa/searchlib/common/bitvector.h> namespace proton { @@ -69,6 +67,17 @@ DocStoreValidator::visitDone(void) (void) _orphans->countTrueBits(); } +uint32_t +DocStoreValidator::getInvalidCount(void) const +{ + return _invalid->countTrueBits(); +} + +uint32_t +DocStoreValidator::getOrphanCount(void) const +{ + return _orphans->countTrueBits(); +} void DocStoreValidator::killOrphans(search::IDocumentStore &store, diff --git a/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.h b/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.h index 6fbaefb9088..fcca1fd9178 100644 --- a/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.h +++ b/searchcore/src/vespa/searchcore/proton/server/docstorevalidator.h @@ -6,60 +6,31 @@ #include <vespa/searchcore/proton/documentmetastore/i_document_meta_store.h> #include <vespa/searchcore/proton/feedoperation/lidvectorcontext.h> -namespace proton -{ +namespace search { class BitVector; } +namespace proton { class DocStoreValidator : public search::IDocumentStoreReadVisitor { - IDocumentMetaStore &_dms; - uint32_t _docIdLimit; - search::BitVector::UP _invalid; - search::BitVector::UP _orphans; - uint32_t _visitCount; - uint32_t _visitEmptyCount; + IDocumentMetaStore &_dms; + uint32_t _docIdLimit; + std::unique_ptr<search::BitVector> _invalid; + std::unique_ptr<search::BitVector> _orphans; + uint32_t _visitCount; + uint32_t _visitEmptyCount; public: DocStoreValidator(IDocumentMetaStore &dms); - virtual void - visit(uint32_t lid, const document::Document &doc); - - virtual void - visit(uint32_t lid); - - void - visitDone(void); - - void - killOrphans(search::IDocumentStore &store, - search::SerialNum serialNum); - - uint32_t - getInvalidCount(void) const - { - return _invalid->countTrueBits(); - } - - uint32_t - getOrphanCount(void) const - { - return _orphans->countTrueBits(); - } - - uint32_t - getVisitCount(void) const - { - return _visitCount; - } - - uint32_t - getVisitEmptyCount(void) const - { - return _visitEmptyCount; - } + virtual void visit(uint32_t lid, const document::Document &doc); + virtual void visit(uint32_t lid); - LidVectorContext::LP - getInvalidLids(void) const; + void visitDone(void); + void killOrphans(search::IDocumentStore &store, search::SerialNum serialNum); + uint32_t getInvalidCount() const; + uint32_t getOrphanCount() const; + uint32_t getVisitCount() const { return _visitCount; } + uint32_t getVisitEmptyCount() const { return _visitEmptyCount; } + LidVectorContext::LP getInvalidLids() const; }; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 97c438dbd09..e3523b4c449 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -2,48 +2,32 @@ #include "documentdb.h" #include "combiningfeedview.h" -#include "configvalidator.h" #include "document_meta_store_read_guards.h" #include "document_subdb_collection_explorer.h" #include "idocumentdbowner.h" #include "lid_space_compaction_handler.h" #include "maintenance_jobs_injector.h" -#include "searchcontext.h" -#include "summaryadapter.h" -#include "tlcproxy.h" #include "commit_and_wait_document_retriever.h" #include "documentdbconfigscout.h" -#include <vespa/searchcore/proton/metrics/metricswireservice.h> +#include "reconfig_params.h" #include <vespa/searchcore/proton/attribute/attribute_writer.h> #include <vespa/searchcore/proton/common/eventlogger.h> #include <vespa/searchcore/proton/common/schemautil.h> -#include <vespa/searchcore/proton/feedoperation/newconfigoperation.h> -#include <vespa/searchcore/proton/feedoperation/noopoperation.h> -#include <vespa/searchcore/proton/feedoperation/wipehistoryoperation.h> #include <vespa/searchcore/proton/index/index_writer.h> #include <vespa/searchcore/proton/initializer/task_runner.h> -#include <vespa/searchcore/proton/matching/matching_stats.h> -#include <vespa/searchcore/proton/metrics/attribute_metrics_collection.h> -#include <vespa/searchcore/proton/persistenceengine/bucket_guard.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/configconverter.h> #include <vespa/searchcommon/common/schemaconfigurer.h> #include <vespa/searchlib/engine/searchreply.h> #include <vespa/searchlib/engine/docsumreply.h> -#include <vespa/searchlib/common/serialnum.h> -#include <vespa/searchlib/common/lambdatask.h> -#include <vespa/vespalib/data/fileheader.h> + #include <vespa/vespalib/io/fileutil.h> -#include <vespa/vespalib/objects/objectvisitor.h> #include <vespa/vespalib/util/closuretask.h> -#include <vespa/vespalib/util/jsonwriter.h> -#include <sstream> #include <vespa/vespalib/util/exceptions.h> #include <vespa/log/log.h> LOG_SETUP(".proton.server.documentdb"); - using vespa::config::search::AttributesConfig; using vespa::config::search::core::ProtonConfig; using search::index::SchemaBuilder; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp b/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp index f511750a32e..cf16498b3be 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp @@ -1,21 +1,14 @@ // Copyright 2016 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(".proton.server.documentretriever"); - #include "documentretriever.h" -#include <vespa/document/base/field.h> #include <vespa/document/datatype/positiondatatype.h> -#include <vespa/document/fieldvalue/structfieldvalue.h> #include <vespa/document/repo/documenttyperepo.h> -#include <vespa/searchcommon/common/schema.h> #include <vespa/searchcore/proton/attribute/document_field_retriever.h> -#include <vespa/searchlib/attribute/attributeguard.h> -#include <vespa/searchlib/attribute/iattributemanager.h> -#include <vespa/searchlib/docstore/idocumentstore.h> -#include <vespa/searchlib/query/base.h> #include <vespa/vespalib/geo/zcurve.h> +#include <vespa/searchlib/attribute/attributevector.h> + +#include <vespa/log/log.h> +LOG_SETUP(".proton.server.documentretriever"); using document::Document; using document::DocumentType; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp index 06d6162baee..846adb1889e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp @@ -1,9 +1,5 @@ // Copyright 2016 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(".proton.server.documentsubdbcollection"); - #include "combiningfeedview.h" #include "commit_and_wait_document_retriever.h" #include "document_subdb_collection_initializer.h" @@ -266,7 +262,7 @@ void DocumentSubDBCollection::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params) + const ReconfigParams & params) { _reprocessingRunner.reset(); for (auto subDb : _subDBs) { diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h index d0c004ceba4..05554e6ec27 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h @@ -117,7 +117,7 @@ public: applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params); + const ReconfigParams & params); IFeedView::SP getFeedView(); IFlushTarget::List getFlushTargets(); 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 24c000e5d4a..5b68ed0c3f2 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 @@ -5,6 +5,7 @@ #include "fast_access_doc_subdb.h" #include "fast_access_document_retriever.h" #include "document_subdb_initializer.h" +#include "reconfig_params.h" #include <vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h> #include <vespa/searchcore/proton/attribute/attribute_factory.h> #include <vespa/searchcore/proton/attribute/attribute_manager_initializer.h> @@ -247,7 +248,7 @@ IReprocessingTask::List FastAccessDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params) + const ReconfigParams & params) { IReprocessingTask::List tasks; updateLidReuseDelayer(&newConfigSnapshot); 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 7274bda8282..e876b18af4e 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 @@ -116,7 +116,7 @@ public: IReprocessingTask::List applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params) override; + const ReconfigParams & params) override; proton::IAttributeManager::SP getAttributeManager() const override; IDocumentRetriever::UP getDocumentRetriever() override; diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp index 3d56edd880d..95a1e99d5ab 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp @@ -13,6 +13,8 @@ #include <vespa/searchsummary/config/config-juniperrc.h> #include <fstream> #include <vespa/fastos/file.h> +#include <vespa/config/helper/configgetter.hpp> + #include <vespa/log/log.h> LOG_SETUP(".proton.server.fileconfigmanager"); diff --git a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h index 5838a66040e..3a2a2e43df9 100644 --- a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h @@ -85,7 +85,7 @@ public: virtual IReprocessingTask::List applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, - SerialNum serialNum, const ReconfigParams params) = 0; + SerialNum serialNum, const ReconfigParams & params) = 0; virtual std::shared_ptr<ISearchHandler> getSearchView() const = 0; virtual std::shared_ptr<IFeedView> getFeedView() const = 0; 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 dcb91d6ab71..26ee44c083d 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 @@ -1,12 +1,9 @@ // Copyright 2016 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(".proton.server.searchable_doc_subdb_configurer"); #include "searchable_doc_subdb_configurer.h" +#include "reconfig_params.h" #include <vespa/searchcore/proton/attribute/attribute_writer.h> #include <vespa/searchcore/proton/common/document_type_inspector.h> -#include <vespa/searchcore/proton/matching/matcher.h> #include <vespa/searchcore/proton/reprocessing/attribute_reprocessing_initializer.h> using namespace vespa::config::search; @@ -112,8 +109,9 @@ SearchableDocSubDBConfigurer(const ISummaryManager::SP &summaryMgr, _clock(clock), _subDbName(subDbName), _distributionKey(distributionKey) -{ -} +{ } + +SearchableDocSubDBConfigurer::~SearchableDocSubDBConfigurer() { } Matchers::UP SearchableDocSubDBConfigurer::createMatchers(const Schema::SP &schema, @@ -127,7 +125,6 @@ SearchableDocSubDBConfigurer::createMatchers(const Schema::SP &schema, properties.add(property.name, property.value); } - LOG(debug, "Adding matcher for rankprofile '%s'", name.c_str()); // schema instance only used during call. Matcher::SP profptr(new Matcher(*schema, properties, _clock, _queryLimiter, _constantValueRepo, _distributionKey)); newMatchers->add(name, profptr); @@ -153,8 +150,7 @@ reconfigure(const DocumentDBConfig &newConfig, const ReconfigParams ¶ms) { assert(!params.shouldAttributeManagerChange()); - AttributeCollectionSpec attrSpec(AttributeCollectionSpec::AttributeList(), - 0, 0); + AttributeCollectionSpec attrSpec(AttributeCollectionSpec::AttributeList(), 0, 0); reconfigure(newConfig, oldConfig, attrSpec, params); } diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h index 2e1110dd07d..447a39085c8 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h @@ -6,7 +6,6 @@ #include "isummaryadapter.h" #include "matchers.h" #include "matchview.h" -#include "reconfig_params.h" #include "searchable_feed_view.h" #include "searchview.h" #include <vespa/searchcore/proton/attribute/i_attribute_writer.h> @@ -26,6 +25,7 @@ namespace proton { +class ReconfigParams; /** * Class used to reconfig the feed view and search view used in a searchable sub database. */ @@ -80,6 +80,7 @@ public: const vespalib::Clock &clock, const vespalib::string &subDbName, uint32_t distributionKey); + ~SearchableDocSubDBConfigurer(); Matchers::UP createMatchers(const search::index::Schema::SP &schema, diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index 2575d2edf84..62c01124248 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -3,6 +3,7 @@ #include "searchabledocsubdb.h" #include "fast_access_document_retriever.h" #include "document_subdb_initializer.h" +#include "reconfig_params.h" #include <vespa/searchcore/proton/attribute/attribute_writer.h> #include <vespa/searchcore/proton/flushengine/threadedflushtarget.h> #include <vespa/searchcore/proton/index/index_manager_initializer.h> @@ -167,7 +168,7 @@ IReprocessingTask::List SearchableDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params) + const ReconfigParams & params) { IReprocessingTask::List tasks; updateLidReuseDelayer(&newConfigSnapshot); diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h index f3b5854395b..b1d80b57bc3 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include "documentdbconfig.h" #include "searchable_doc_subdb_configurer.h" #include "executorthreadingservice.h" #include "fast_access_doc_subdb.h" @@ -26,11 +25,11 @@ #include <vespa/vespalib/util/varholder.h> -namespace proton -{ +namespace proton { class MetricsWireService; class DocumentDBMetrics; +class DocumentDBConfig; /** * The searchable sub database supports searching and keeps all attribute fields in memory and @@ -110,83 +109,56 @@ protected: void updateLidReuseDelayer(const LidReuseDelayerConfig &config) override; public: SearchableDocSubDB(const Config &cfg, const Context &ctx); - ~SearchableDocSubDB(); std::unique_ptr<DocumentSubDbInitializer> createInitializer(const DocumentDBConfig &configSnapshot, SerialNum configSerialNum, - const search::index::Schema::SP &unionSchema, + const Schema::SP &unionSchema, const vespa::config::search::core:: ProtonConfig::Summary &protonSummaryCfg, const vespa::config::search::core:: ProtonConfig::Index &indexCfg) const override; - virtual void setup(const DocumentSubDbInitializerResult &initResult) - override; + void setup(const DocumentSubDbInitializerResult &initResult) override; - virtual void + void initViews(const DocumentDBConfig &configSnapshot, - const matching::SessionManager::SP &sessionManager); + const matching::SessionManager::SP &sessionManager) override; - virtual IReprocessingTask::List + IReprocessingTask::List applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params); + const ReconfigParams & params) override; - virtual void - clearViews() + void clearViews() override { _rFeedView.clear(); _rSearchView.clear(); Parent::clearViews(); } - virtual proton::IAttributeManager::SP - getAttributeManager() const - { + proton::IAttributeManager::SP getAttributeManager() const override { return _rSearchView.get()->getAttributeManager(); } - virtual const IIndexManager::SP & - getIndexManager() const - { + const IIndexManager::SP &getIndexManager() const override { return _indexMgr; } - virtual const IIndexWriter::SP & - getIndexWriter() const - { + const IIndexWriter::SP &getIndexWriter() const override { return _indexWriter; } - virtual SerialNum - getOldestFlushedSerial(); - - virtual SerialNum - getNewestFlushedSerial(); - - virtual void - wipeHistory(SerialNum wipeSerial, - const search::index::Schema &newHistorySchema, - const search::index::Schema &wipeSchema); - - virtual void - setIndexSchema(const search::index::Schema::SP &schema, - const search::index::Schema::SP &fusionSchema); - - virtual size_t - getNumActiveDocs() const override; - - virtual search::SearchableStats - getSearchableStats() const; - - virtual IDocumentRetriever::UP - getDocumentRetriever(); - - virtual matching::MatchingStats - getMatcherStats(const vespalib::string &rankProfile) const; + SerialNum getOldestFlushedSerial() override; + SerialNum getNewestFlushedSerial() override; + void wipeHistory(SerialNum wipeSerial, const Schema &newHistorySchema, const Schema &wipeSchema) override; + void setIndexSchema(const Schema::SP &schema, const Schema::SP &fusionSchema) override; + size_t getNumActiveDocs() const override; + search::SearchableStats getSearchableStats() const override ; + IDocumentRetriever::UP getDocumentRetriever() override; + matching::MatchingStats getMatcherStats(const vespalib::string &rankProfile) const override; }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp index cc35d7649ce..e41c4ab6ed1 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp @@ -385,7 +385,7 @@ IReprocessingTask::List StoreOnlyDocSubDB::applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params) + const ReconfigParams & params) { (void) oldConfigSnapshot; assert(_writeService.master().isCurrentThread()); diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h index 00dcb10941c..a565da524a4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h @@ -247,7 +247,7 @@ public: applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, SerialNum serialNum, - const ReconfigParams params) override; + const ReconfigParams & params) override; ISearchHandler::SP getSearchView() const override { return _iSearchView.get(); } IFeedView::SP getFeedView() const override { return _iFeedView.get(); } diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h index d1f84031417..9c3bc57bbdf 100644 --- a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h +++ b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h @@ -48,7 +48,7 @@ struct DummyDocumentSubDb : public IDocumentSubDB virtual DocumentSubDbInitializer::UP createInitializer(const DocumentDBConfig &, SerialNum, - const search::index::Schema::SP &, + const Schema::SP &, const vespa::config::search::core::ProtonConfig:: Summary &, const vespa::config::search::core:: @@ -63,7 +63,7 @@ struct DummyDocumentSubDb : public IDocumentSubDB virtual IReprocessingTask::List applyConfig(const DocumentDBConfig &, const DocumentDBConfig &, SerialNum, - const ReconfigParams) override { + const ReconfigParams &) override { return IReprocessingTask::List(); } virtual ISearchHandler::SP getSearchView() const override { return ISearchHandler::SP(); } @@ -85,12 +85,9 @@ struct DummyDocumentSubDb : public IDocumentSubDB virtual void onReprocessDone(SerialNum) override { } virtual SerialNum getOldestFlushedSerial() override { return 0; } virtual SerialNum getNewestFlushedSerial() override { return 0; } - virtual void wipeHistory(SerialNum, - const search::index::Schema &, - const search::index::Schema &) override {} - virtual void setIndexSchema(const search::index::Schema::SP &, - const search::index::Schema::SP &) override {} - virtual search::SearchableStats getSearchableStats(void) const override { + virtual void wipeHistory(SerialNum, const Schema &, const Schema &) override { } + virtual void setIndexSchema(const Schema::SP &, const Schema::SP &) override { } + virtual search::SearchableStats getSearchableStats() const override { return search::SearchableStats(); } virtual IDocumentRetriever::UP getDocumentRetriever() override { |