diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-03 22:27:46 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-03 22:27:46 +0200 |
commit | 4528968a367818c52491edc05411d03829d0c173 (patch) | |
tree | 19fdc47b472ba17b8bb63eb4c48a16f1c81321a1 | |
parent | f8b00126134987087ce83c07b6085be9ff19990c (diff) |
Deinline large destructor and uses nested namespace
12 files changed, 29 insertions, 46 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp index 52eb4c8d31b..1e429616e7e 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp @@ -15,8 +15,7 @@ using namespace search::fef::indexproperties::matchphase; using namespace search::fef::indexproperties::matching; using search::IDocumentMetaStore; -namespace proton { -namespace matching { +namespace proton::matching { namespace { @@ -72,6 +71,8 @@ MatchTools::MatchTools(QueryLimiter & queryLimiter, HandleRecorder::Binder bind(_handleRecorder); } +MatchTools::~MatchTools() {} + search::fef::RankProgram::UP MatchTools::first_phase_program() const { auto program = setup_program(_rankSetup.create_first_phase_program(), @@ -167,6 +168,8 @@ MatchToolsFactory(QueryLimiter & queryLimiter, } } +MatchToolsFactory::~MatchToolsFactory() {} + MatchTools::UP MatchToolsFactory::createMatchTools() const { @@ -176,5 +179,4 @@ MatchToolsFactory::createMatchTools() const _mdl, _rankSetup, _featureOverrides)); } -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h index 093f1f5ed12..1c0d9aff497 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h @@ -17,8 +17,7 @@ #include <vespa/searchlib/fef/fef.h> #include <vespa/searchlib/common/idocumentmetastore.h> -namespace proton { -namespace matching { +namespace proton::matching { class MatchTools { @@ -47,6 +46,7 @@ public: const search::fef::MatchDataLayout &mdl, const search::fef::RankSetup &rankSetup, const search::fef::Properties &featureOverrides); + ~MatchTools(); const vespalib::Doom &getSoftDoom() const { return _softDoom; } const vespalib::Doom &getHardDoom() const { return _hardDoom; } QueryLimiter & getQueryLimiter() { return _queryLimiter; } @@ -92,11 +92,11 @@ public: const search::fef::RankSetup &rankSetup, const search::fef::Properties &rankProperties, const search::fef::Properties &featureOverrides); + ~MatchToolsFactory(); bool valid() const { return _valid; } const MaybeMatchPhaseLimiter &match_limiter() const { return *_match_limiter; } MatchTools::UP createMatchTools() const; search::queryeval::Blueprint::HitEstimate estimate() const { return _query.estimate(); } }; -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 0ee09f6e479..1e7839e9714 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -30,8 +30,7 @@ using search::queryeval::Blueprint; using search::queryeval::SearchIterator; using vespalib::Doom; -namespace proton { -namespace matching { +namespace proton::matching { namespace { @@ -269,6 +268,7 @@ Matcher::match(const SearchRequest &request, size_t estimate = std::min(static_cast<size_t>(metaStore.getCommittedDocIdLimit()), mtf->match_limiter().getDocIdSpaceEstimate()); bool wasLimited = mtf->match_limiter().was_limited(); + uint32_t estHits = mtf->estimate().estHits; if (shouldCacheSearchSession && ((result->_numFs4Hits != 0) || shouldCacheGroupingSession)) { SearchSession::SP session = std::make_shared<SearchSession>(sessionId, request.getTimeOfDoom(), std::move(mtf), std::move(owned_objects)); @@ -289,7 +289,7 @@ Matcher::match(const SearchRequest &request, coverage.setCovered(std::min(static_cast<size_t>(metaStore.getNumActiveLids()), (estimate * metaStore.getNumActiveLids())/metaStore.getCommittedDocIdLimit())); LOG(debug, "numThreadsPerSearch = %zu. Configured = %d, estimated hits=%d, totalHits=%ld", - numThreadsPerSearch, _rankSetup->getNumThreadsPerSearch(), mtf->estimate().estHits, reply->totalHitCount); + numThreadsPerSearch, _rankSetup->getNumThreadsPerSearch(), estHits, reply->totalHitCount); } total_matching_time.stop(); my_stats.queryCollateralTime(total_matching_time.elapsed().sec() - my_stats.queryLatencyAvg()); @@ -324,5 +324,4 @@ Matcher::getRankFeatures(const DocsumRequest & req, return getFeatureSet(req, searchCtx, attrCtx, sessionMgr, false); } -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.h b/searchcore/src/vespa/searchcore/proton/matching/matcher.h index 34832df46f1..42a74e3c29b 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.h @@ -36,8 +36,7 @@ class IDocumentMetaStore; } // namespace search -namespace proton { -namespace matching { +namespace proton::matching { class ISearchContext; class SessionManager; @@ -178,6 +177,4 @@ public: double get_termwise_limit() const { return _rankSetup->get_termwise_limit(); } }; -} // namespace matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp index e9f5a3ee7b4..de46386d6e1 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp @@ -2,8 +2,7 @@ #include "matching_stats.h" -namespace proton { -namespace matching { +namespace proton::matching { namespace { @@ -83,4 +82,3 @@ MatchingStats::updatesoftDoomFactor(double hardLimit, double softLimit, double d } } -} // namespace searchcore diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h index cda26c109fc..99084098f6f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.h @@ -5,8 +5,7 @@ #include <vector> #include <cstddef> -namespace proton { -namespace matching { +namespace proton::matching { /** * Statistics for the matching pipeline. Used for internal aggregation @@ -154,6 +153,4 @@ public: MatchingStats &add(const MatchingStats &rhs); }; -} // namespace matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index b8987aae42e..e6408e89896 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -79,6 +79,7 @@ void AddLocationNode(const string &location_str, Node::UP &query_tree, Location } } // namespace +Query::Query() {} Query::~Query() {} bool diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.h b/searchcore/src/vespa/searchcore/proton/matching/query.h index 4e050e72707..5c770e08353 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.h +++ b/searchcore/src/vespa/searchcore/proton/matching/query.h @@ -25,6 +25,7 @@ private: Blueprint::UP _blackListBlueprint; public: + Query(); ~Query(); /** * Build query tree from a stack dump. diff --git a/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp b/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp index 119efee5f23..8a5d22012e6 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/search_session.cpp @@ -3,8 +3,7 @@ #include "match_tools.h" #include "match_context.h" -namespace proton { -namespace matching { +namespace proton::matching { SearchSession::SearchSession(const SessionId &id, fastos::TimeStamp time_of_doom, std::unique_ptr<MatchToolsFactory> match_tools_factory, @@ -28,4 +27,3 @@ SearchSession::OwnershipBundle::OwnershipBundle() { } SearchSession::OwnershipBundle::~OwnershipBundle() { } } -} diff --git a/searchcore/src/vespa/searchcore/proton/matching/search_session.h b/searchcore/src/vespa/searchcore/proton/matching/search_session.h index 234a8e8078c..691a33022c3 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/search_session.h +++ b/searchcore/src/vespa/searchcore/proton/matching/search_session.h @@ -7,12 +7,9 @@ #include <memory> #include <vespa/fastos/timestamp.h> -namespace search { -namespace fef { class Properties; } -} +namespace search::fef { class Properties; } -namespace proton { -namespace matching { +namespace proton::matching { class MatchToolsFactory; class MatchContext; @@ -65,6 +62,4 @@ public: MatchToolsFactory &getMatchToolsFactory() { return *_match_tools_factory; } }; -} // namespace proton::matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp index 2b808fb2a67..65db20dd775 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.cpp @@ -10,8 +10,7 @@ LOG_SETUP(".sessionmanager"); using search::grouping::GroupingSession; -namespace proton { -namespace matching { +namespace proton::matching { namespace { using Stats = SessionManager::Stats; @@ -231,5 +230,4 @@ size_t SessionManager::getNumSearchSessions() const { return _search_map->size(); } -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.h b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.h index cd479244c87..8426ab258e0 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.h +++ b/searchcore/src/vespa/searchcore/proton/matching/sessionmanager.h @@ -7,8 +7,7 @@ #include <vespa/searchcore/grouping/sessionid.h> #include <vespa/vespalib/stllike/lrucache_map.h> -namespace proton { -namespace matching { +namespace proton::matching { typedef vespalib::string SessionId; @@ -67,6 +66,4 @@ public: void close(); }; -} // namespace proton::matching -} // namespace proton - +} |