diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-08 21:12:54 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-09 07:16:21 +0000 |
commit | 24dffd4f0f2e3f2629bfe997b81374e1dad66c39 (patch) | |
tree | 92a3ad0bd40f29a7061aa2bcd85e191eb7819825 /searchcore | |
parent | 35185162ec0d55a9cc438c1ddd405989684b4a01 (diff) |
Deinline as compiler makes the best choices.
Diffstat (limited to 'searchcore')
9 files changed, 55 insertions, 37 deletions
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 50a8ff20c45..6bf9544b3ea 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 @@ -206,6 +206,7 @@ struct SequentialAttributeManager { mgr.addInitializedAttributes(initializer.getInitializedAttributes()); } + ~SequentialAttributeManager() {} }; struct DummyInitializerTask : public InitializerTask diff --git a/searchcore/src/vespa/searchcore/proton/common/cachedselect.cpp b/searchcore/src/vespa/searchcore/proton/common/cachedselect.cpp index 25bb9bf0f21..934737122e7 100644 --- a/searchcore/src/vespa/searchcore/proton/common/cachedselect.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/cachedselect.cpp @@ -1,8 +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.common.cachedselect"); #include "cachedselect.h" #include <vespa/document/select/valuenode.h> #include <vespa/document/select/cloningvisitor.h> @@ -11,14 +8,18 @@ LOG_SETUP(".proton.common.cachedselect"); #include <vespa/document/select/parser.h> #include "selectpruner.h" -namespace proton -{ +#include <vespa/log/log.h> +LOG_SETUP(".proton.common.cachedselect"); + +namespace proton { using search::AttributeVector; using search::AttributeGuard; using document::select::FieldValueNode; using search::attribute::CollectionType; +namespace { + class AttrVisitor : public document::select::CloningVisitor { public: @@ -31,32 +32,24 @@ public: uint32_t _mvAttrs; uint32_t _complexAttrs; - uint32_t - getFieldNodes(void) const - { - return _fieldNodes; - } + uint32_t getFieldNodes() const { return _fieldNodes; } - static uint32_t - invalidIdx(void) - { + static uint32_t invalidIdx() { return std::numeric_limits<uint32_t>::max(); } - AttrVisitor(const search::IAttributeManager &amgr, - CachedSelect &cachedSelect); + AttrVisitor(const search::IAttributeManager &amgr, CachedSelect &cachedSelect); + ~AttrVisitor(); /* * Mutate field value nodes representing single value attributes into * attribute field valulue nodes. */ - virtual void - visitFieldValueNode(const FieldValueNode &expr) override; + void visitFieldValueNode(const FieldValueNode &expr) override; }; -AttrVisitor::AttrVisitor(const search::IAttributeManager &amgr, - CachedSelect &cachedSelect) +AttrVisitor::AttrVisitor(const search::IAttributeManager &amgr, CachedSelect &cachedSelect) : CloningVisitor(), _amap(), _amgr(amgr), @@ -64,9 +57,9 @@ AttrVisitor::AttrVisitor(const search::IAttributeManager &amgr, _svAttrs(0u), _mvAttrs(0u), _complexAttrs(0u) -{ -} +{} +AttrVisitor::~AttrVisitor() { } void AttrVisitor::visitFieldValueNode(const FieldValueNode &expr) @@ -107,9 +100,7 @@ AttrVisitor::visitFieldValueNode(const FieldValueNode &expr) idx = it->second; } assert(idx != invalidIdx()); - _valueNode.reset(new AttributeFieldValueNode(expr.getDocType(), - name, - av)); + _valueNode.reset(new AttributeFieldValueNode(expr.getDocType(), name, av)); } else { // Don't try to optimize multivalue attribute vectors yet ++_mvAttrs; @@ -120,6 +111,7 @@ AttrVisitor::visitFieldValueNode(const FieldValueNode &expr) } } +} CachedSelect::CachedSelect(void) : _attributes(), @@ -141,8 +133,7 @@ CachedSelect::set(const vespalib::string &selection, const document::DocumentTypeRepo &repo) { try { - document::select::Parser parser(repo, - document::BucketIdFactory()); + document::select::Parser parser(repo, document::BucketIdFactory()); _select = parser.parse(selection); } catch (document::select::ParsingFailedException &) { _select.reset(NULL); diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp index 1843a67b507..c45d9ca7c6d 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp @@ -28,6 +28,11 @@ using vespalib::string; namespace proton { namespace matching { +ProtonTermData::ProtonTermData() = default; +ProtonTermData::ProtonTermData(const ProtonTermData &) = default; +ProtonTermData & ProtonTermData::operator = (const ProtonTermData &) = default; +ProtonTermData::~ProtonTermData() { } + void ProtonTermData::setDocumentFrequency(double freq) { diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h index e29fdb4630f..f142163fc6a 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h @@ -56,6 +56,12 @@ protected: bool forceFilter); public: + ProtonTermData(); + ProtonTermData(const ProtonTermData &); + ProtonTermData & operator = (const ProtonTermData &); + ProtonTermData(ProtonTermData &&) = default; + ProtonTermData & operator = (ProtonTermData &&) = default; + ~ProtonTermData(); void resolveFromChildren(const std::vector<search::query::Node *> &children); void allocateTerms(search::fef::MatchDataLayout &mdl); void setDocumentFrequency(uint32_t estHits, uint32_t numDocs); @@ -75,7 +81,7 @@ inline uint32_t numTerms<search::query::Phrase>(const search::query::Phrase &n) template <typename Base> struct ProtonTermBase : public Base, - public ProtonTermData + public ProtonTermData { using Base::Base; @@ -96,6 +102,7 @@ struct ProtonTermBase : public Base, template <typename Base> struct ProtonTerm : public ProtonTermBase<Base> { using ProtonTermBase<Base>::ProtonTermBase; + ~ProtonTerm() {} }; typedef search::query::SimpleAnd ProtonAnd; diff --git a/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt index faa332a0aa9..9ed77dec799 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt @@ -4,6 +4,7 @@ vespa_add_library(searchcore_proton_metrics STATIC attribute_metrics.cpp content_proton_metrics.cpp documentdb_job_trackers.cpp + documentdb_metrics_collection.cpp documentdb_tagged_metrics.cpp executor_metrics.cpp feed_metrics.cpp diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp new file mode 100644 index 00000000000..044ab7c6d10 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.cpp @@ -0,0 +1,15 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "documentdb_metrics_collection.h" + +namespace proton { + +DocumentDBMetricsCollection::DocumentDBMetricsCollection(const vespalib::string &docTypeName, size_t maxNumThreads) + : _metrics(docTypeName, maxNumThreads), + _taggedMetrics(docTypeName) +{} + +DocumentDBMetricsCollection::~DocumentDBMetricsCollection() {} + +} // namespace proton + diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h index 3a2b0ff8633..28ce7a94442 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h +++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_metrics_collection.h @@ -16,11 +16,8 @@ private: DocumentDBTaggedMetrics _taggedMetrics; public: - DocumentDBMetricsCollection(const vespalib::string &docTypeName, size_t maxNumThreads) - : _metrics(docTypeName, maxNumThreads), - _taggedMetrics(docTypeName) - { - } + DocumentDBMetricsCollection(const vespalib::string &docTypeName, size_t maxNumThreads); + ~DocumentDBMetricsCollection(); LegacyDocumentDBMetrics &getLegacyMetrics() { return _metrics; } DocumentDBTaggedMetrics &getTaggedMetrics() { return _taggedMetrics; } }; diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp index ff538ea8c68..cf515890e74 100644 --- a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp +++ b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp @@ -1,11 +1,10 @@ // 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 "document_reprocessing_handler.h" + #include <vespa/log/log.h> LOG_SETUP(".proton.reprocessing.document_reprocessing_handler"); -#include "document_reprocessing_handler.h" - namespace proton { void @@ -26,8 +25,9 @@ DocumentReprocessingHandler::DocumentReprocessingHandler(uint32_t docIdLimit) _rewriters(), _rewriteVisitor(*this), _docIdLimit(docIdLimit) -{ -} +{} + +DocumentReprocessingHandler::~DocumentReprocessingHandler() {} void DocumentReprocessingHandler::visit(uint32_t lid, const document::Document &doc) diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.h b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.h index 0f7feed137e..f1a41d398e5 100644 --- a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.h +++ b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.h @@ -39,6 +39,7 @@ private: public: DocumentReprocessingHandler(uint32_t docIdLimit); + ~DocumentReprocessingHandler(); bool hasReaders() const { return !_readers.empty(); |