From be11fc0adb411f7ff2b13cdee911620bc5ba0d76 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 22 Aug 2017 11:47:54 +0200 Subject: Move instead of copy. --- searchlib/src/vespa/searchlib/aggregation/group.cpp | 10 +++++----- searchlib/src/vespa/searchlib/aggregation/group.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'searchlib') diff --git a/searchlib/src/vespa/searchlib/aggregation/group.cpp b/searchlib/src/vespa/searchlib/aggregation/group.cpp index 6eb131fe77d..4172de3c086 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.cpp +++ b/searchlib/src/vespa/searchlib/aggregation/group.cpp @@ -206,10 +206,10 @@ Group & Group::operator = (const Group & rhs) = default; Group::~Group() { } Group & -Group::partialCopy(const Group & rhs) { +Group::partialMove(Group &rhs) { setId(*rhs._id); _rank = rhs._rank; - _aggr.partialCopy(rhs._aggr); + _aggr.partialMove(rhs._aggr); return *this; } @@ -373,7 +373,7 @@ void Group::Value::mergeLevel(const Group & protoType, const Value & b) { for (ChildP *it(b._children), *mt(b._children + b.getChildrenSize()); it != mt; ++it) { ChildP g(new Group(protoType)); - g->partialCopy(**it); + g->partialMove(**it); addChild(g); } } @@ -735,10 +735,10 @@ Group::Value::swap(Value & rhs) void -Group::Value::partialCopy(const Value & rhs) { +Group::Value::partialMove(Value &rhs) { uint32_t totalAggrSize = getAggrSize() + getExprSize(); for(size_t i(0), m(totalAggrSize); i < m; i++) { - _aggregationResults[i] = rhs._aggregationResults[i]; + _aggregationResults[i] = std::move(rhs._aggregationResults[i]); } for(size_t i(0), m(getAggrSize()); i < m; i++) { getAggr(i)->reset(); diff --git a/searchlib/src/vespa/searchlib/aggregation/group.h b/searchlib/src/vespa/searchlib/aggregation/group.h index b34bd0fc88a..80db20015d3 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.h +++ b/searchlib/src/vespa/searchlib/aggregation/group.h @@ -102,7 +102,7 @@ private: void merge(const GroupingLevelList & levels, uint32_t firstLevel, uint32_t currentLevel, const Value & rhs); void prune(const Value & b, uint32_t lastLevel, uint32_t currentLevel); void postMerge(const std::vector &levels, uint32_t firstLevel, uint32_t currentLevel); - void partialCopy(const Value & rhs); + void partialMove(Value &rhs); VESPA_DLL_LOCAL Group * groupSingle(const ResultNode & selectResult, HitRank rank, const GroupingLevel & level); GroupList groups() const { return _children; } @@ -167,7 +167,7 @@ private: RawRank _rank; // The default rank taken from the highest hit relevance. Value _aggr; - Group & partialCopy(const Group & rhs); + Group & partialMove(Group &rhs); template VESPA_DLL_LOCAL void groupNext(const GroupingLevel & level, const Doc & docId, HitRank rank); -- cgit v1.2.3 From ca9e189a2c430a85aca92ad8f39ed6642b117c83 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 22 Aug 2017 13:27:25 +0200 Subject: Reduce visibility. --- .../documentdb/configurer/configurer_test.cpp | 1 + .../vespa/searchcore/grouping/groupingcontext.h | 8 +--- .../vespa/searchcore/grouping/groupingmanager.cpp | 17 +++++---- .../vespa/searchcore/grouping/groupingmanager.h | 22 ++++++----- .../vespa/searchcore/grouping/groupingsession.cpp | 26 ++++++------- .../vespa/searchcore/grouping/groupingsession.h | 43 ++++++++++------------ .../searchcore/proton/matching/match_thread.cpp | 7 ++-- .../searchcore/proton/matching/match_thread.h | 6 +-- .../vespa/searchcore/proton/matching/matcher.cpp | 1 + .../proton/matching/result_processor.cpp | 8 ++-- .../searchcore/proton/matching/result_processor.h | 7 +--- .../proton/matching/session_manager_explorer.cpp | 7 ++-- .../proton/matching/session_manager_explorer.h | 11 +++--- .../vespa/searchcore/proton/server/documentdb.h | 5 ++- .../proton/server/fast_access_doc_subdb.h | 9 +++-- .../vespa/searchcore/proton/server/matchview.cpp | 3 +- .../src/vespa/searchcore/proton/server/matchview.h | 13 ++++--- .../searchcore/proton/server/searchabledocsubdb.h | 2 +- .../vespa/searchcore/proton/server/searchview.h | 3 +- searchlib/src/vespa/searchlib/aggregation/group.h | 2 +- 20 files changed, 100 insertions(+), 101 deletions(-) (limited to 'searchlib') diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 4083a7e1194..650944d0f94 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/searchcore/src/vespa/searchcore/grouping/groupingcontext.h b/searchcore/src/vespa/searchcore/grouping/groupingcontext.h index 7ebc2c36985..92a9dc06fff 100644 --- a/searchcore/src/vespa/searchcore/grouping/groupingcontext.h +++ b/searchcore/src/vespa/searchcore/grouping/groupingcontext.h @@ -6,9 +6,7 @@ #include #include -namespace search { - -namespace grouping { +namespace search::grouping { /** * A Grouping Context contains all grouping expressions that should be evaluated @@ -115,6 +113,4 @@ public: bool needRanking() const; }; -} // namespace search::grouping -} // namespace search - +} diff --git a/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp b/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp index 7913043265a..48baba329ca 100644 --- a/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp +++ b/searchcore/src/vespa/searchcore/grouping/groupingmanager.cpp @@ -1,18 +1,18 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "groupingmanager.h" +#include "groupingsession.h" +#include "groupingcontext.h" #include #include -#include #include LOG_SETUP(".groupingmanager"); -namespace search { -namespace grouping { +namespace search::grouping { -using search::aggregation::Grouping; -using search::attribute::IAttributeContext; +using aggregation::Grouping; +using attribute::IAttributeContext; //----------------------------------------------------------------------------- @@ -31,6 +31,10 @@ using search::expression::ConfigureStaticParams; using search::aggregation::Grouping; using search::aggregation::GroupingLevel; +bool GroupingManager::empty() const { + return _groupingContext.getGroupingList().empty(); +} + void GroupingManager::init(const IAttributeContext &attrCtx) { @@ -126,5 +130,4 @@ GroupingManager::convertToGlobalId(const search::IDocumentMetaStore &metaStore) } } -} // namespace search::grouping -} // namespace search +} diff --git a/searchcore/src/vespa/searchcore/grouping/groupingmanager.h b/searchcore/src/vespa/searchcore/grouping/groupingmanager.h index 1a440bf9247..5793c8576e5 100644 --- a/searchcore/src/vespa/searchcore/grouping/groupingmanager.h +++ b/searchcore/src/vespa/searchcore/grouping/groupingmanager.h @@ -2,12 +2,16 @@ #pragma once #include -#include -#include +#include namespace search { + class RankedHit; + class BitVector; +} -namespace grouping { +namespace search::grouping { + +class GroupingContext; /** * Wrapper class used to handle actual grouping. All input data is @@ -37,14 +41,14 @@ public: /** * @return true if this manager is holding an empty grouping request. **/ - bool empty() const { return _groupingContext.getGroupingList().empty(); } + bool empty() const; /** * Initialize underlying context with attribute bindings. * * @param attrCtx attribute context **/ - void init(const search::attribute::IAttributeContext &attrCtx); + void init(const attribute::IAttributeContext &attrCtx); /** * Perform actual grouping on the given results. @@ -65,7 +69,7 @@ public: * @param binSize size of search result array * @param overflow The unranked hits. **/ - void groupUnordered(const RankedHit *searchResults, uint32_t binSize, const search::BitVector * overflow); + void groupUnordered(const RankedHit *searchResults, uint32_t binSize, const BitVector * overflow); /** * Merge another grouping context into the underlying context of @@ -89,9 +93,7 @@ public: * * @param metaStore the attribute used to map from lid to gid. **/ - void convertToGlobalId(const search::IDocumentMetaStore &metaStore); + void convertToGlobalId(const IDocumentMetaStore &metaStore); }; -} // namespace search::grouping -} // namespace search - +} diff --git a/searchcore/src/vespa/searchcore/grouping/groupingsession.cpp b/searchcore/src/vespa/searchcore/grouping/groupingsession.cpp index 6407a29175e..110d032205e 100644 --- a/searchcore/src/vespa/searchcore/grouping/groupingsession.cpp +++ b/searchcore/src/vespa/searchcore/grouping/groupingsession.cpp @@ -1,11 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "groupingsession.h" +#include "groupingmanager.h" +#include "groupingcontext.h" + #include LOG_SETUP(".groupingsession"); -namespace search { -namespace grouping { +namespace search::grouping { using search::aggregation::Group; using search::aggregation::Grouping; @@ -16,8 +18,8 @@ GroupingSession::GroupingSession(const SessionId &sessionId, GroupingContext & groupingContext, const IAttributeContext &attrCtx) : _sessionId(sessionId), - _mgrContext(groupingContext), - _groupingManager(_mgrContext), + _mgrContext(std::make_unique(groupingContext)), + _groupingManager(std::make_unique(*_mgrContext)), _timeOfDoom(groupingContext.getTimeOfDoom()) { init(groupingContext, attrCtx); @@ -46,31 +48,30 @@ GroupingSession::init(GroupingContext & groupingContext, const IAttributeContext _groupingMap[gp->getId()] = gp; g = gp; } - _mgrContext.addGrouping(g); + _mgrContext->addGrouping(g); } - _groupingManager.init(attrCtx); + _groupingManager->init(attrCtx); } void GroupingSession::prepareThreadContextCreation(size_t num_threads) { if (num_threads > 1) { - _mgrContext.serialize(); // need copy of internal modified request + _mgrContext->serialize(); // need copy of internal modified request } } GroupingContext::UP GroupingSession::createThreadContext(size_t thread_id, const IAttributeContext &attrCtx) { - GroupingContext::UP ctx(new GroupingContext(_mgrContext)); + GroupingContext::UP ctx(new GroupingContext(*_mgrContext)); if (thread_id == 0) { - GroupingContext::GroupingList &groupingList = _mgrContext.getGroupingList(); + GroupingContext::GroupingList &groupingList = _mgrContext->getGroupingList(); for (size_t i = 0; i < groupingList.size(); ++i) { ctx->addGrouping(groupingList[i]); } } else { - ctx->deserialize(_mgrContext.getResult().peek(), - _mgrContext.getResult().size()); + ctx->deserialize(_mgrContext->getResult().peek(), _mgrContext->getResult().size()); GroupingManager man(*ctx); man.init(attrCtx); } @@ -97,5 +98,4 @@ GroupingSession::continueExecution(GroupingContext & groupingContext) groupingContext.serialize(); } -} // namespace search::grouping -} // namespace search +} diff --git a/searchcore/src/vespa/searchcore/grouping/groupingsession.h b/searchcore/src/vespa/searchcore/grouping/groupingsession.h index 62867289be7..95a5332b417 100644 --- a/searchcore/src/vespa/searchcore/grouping/groupingsession.h +++ b/searchcore/src/vespa/searchcore/grouping/groupingsession.h @@ -1,16 +1,17 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include "groupingmanager.h" -#include "groupingcontext.h" #include "sessionid.h" -#include +#include +#include +#include #include +namespace search::aggregation { class Grouping; } +namespace search::grouping { -namespace search { - -namespace grouping { +class GroupingContext; +class GroupingManager; /** * A grouping session represents the execution of a grouping expression with one @@ -21,15 +22,15 @@ namespace grouping { class GroupingSession { private: - typedef std::shared_ptr GroupingPtr; - typedef std::map GroupingMap; - typedef std::vector GroupingList; + using GroupingPtr = std::shared_ptr; + using GroupingMap = std::map; + using GroupingList = std::vector; - SessionId _sessionId; - GroupingContext _mgrContext; - GroupingManager _groupingManager; - GroupingMap _groupingMap; - fastos::TimeStamp _timeOfDoom; + SessionId _sessionId; + std::unique_ptr _mgrContext; + std::unique_ptr _groupingManager; + GroupingMap _groupingMap; + fastos::TimeStamp _timeOfDoom; public: typedef std::unique_ptr UP; @@ -43,7 +44,7 @@ public: **/ GroupingSession(const SessionId & sessionId, GroupingContext & groupingContext, - const search::attribute::IAttributeContext &attrCtx); + const attribute::IAttributeContext &attrCtx); GroupingSession(const GroupingSession &) = delete; GroupingSession &operator=(const GroupingSession &) = delete; @@ -62,8 +63,7 @@ public: * @param groupingContext The current grouping context. * @param attrCtx attribute context. **/ - void init(GroupingContext & groupingContext, - const search::attribute::IAttributeContext &attrCtx); + void init(GroupingContext & groupingContext, const attribute::IAttributeContext &attrCtx); /** * This function is called to prepare for creation of individual @@ -85,13 +85,12 @@ public: * @param thread_id thread id * @param attrCtx attribute context. **/ - GroupingContext::UP createThreadContext(size_t thread_id, - const search::attribute::IAttributeContext &attrCtx); + std::unique_ptr createThreadContext(size_t thread_id, const attribute::IAttributeContext &attrCtx); /** * Return the GroupingManager to use when performing grouping. **/ - GroupingManager & getGroupingManager() { return _groupingManager; } + GroupingManager & getGroupingManager() { return *_groupingManager; } /** * Continue excuting a query given a context. @@ -112,6 +111,4 @@ public: fastos::TimeStamp getTimeOfDoom() const { return _timeOfDoom; } }; -} // namespace search::grouping -} // namespace search - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp index 4ece0c65593..1d5abcc2929 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp @@ -9,13 +9,13 @@ #include #include #include +#include #include #include LOG_SETUP(".proton.matching.match_thread"); -namespace proton { -namespace matching { +namespace proton::matching { using search::queryeval::OptimizedAndNotForBlackListing; using search::queryeval::SearchIterator; @@ -402,5 +402,4 @@ MatchThread::run() mergeDirector.dualMerge(thread_id, *resultContext->result, resultContext->groupingSource); } -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.h b/searchcore/src/vespa/searchcore/proton/matching/match_thread.h index 9287089c34e..cd01c330931 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.h @@ -15,8 +15,7 @@ #include #include -namespace proton { -namespace matching { +namespace proton::matching { /** * Runs a single match thread and keeps track of local state. @@ -111,5 +110,4 @@ public: PartialResult::UP extract_result() { return std::move(resultContext->result); } }; -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 852176e4918..32775d7619a 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -7,6 +7,7 @@ #include "match_params.h" #include "matcher.h" #include "sessionmanager.h" +#include #include #include #include diff --git a/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp b/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp index 1e7acead748..e2c6affebe1 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp @@ -3,6 +3,8 @@ #include "result_processor.h" #include "partial_result.h" #include "sessionmanager.h" +#include +#include #include #include #include @@ -15,8 +17,7 @@ using search::grouping::GroupingSession; using search::grouping::GroupingContext; using search::grouping::SessionId; -namespace proton { -namespace matching { +namespace proton::matching { ResultProcessor::Result::Result(std::unique_ptr reply, size_t numFs4Hits) : _reply(std::move(reply)), @@ -158,5 +159,4 @@ ResultProcessor::makeReply(PartialResultUP full_result) return Result::UP(new Result(std::move(reply), numFs4Hits)); } -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/result_processor.h b/searchcore/src/vespa/searchcore/proton/matching/result_processor.h index 0a9b88c066a..a181c1660b7 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/result_processor.h +++ b/searchcore/src/vespa/searchcore/proton/matching/result_processor.h @@ -16,8 +16,7 @@ namespace search { class IDocumentMetaStore; } -namespace proton { -namespace matching { +namespace proton::matching { class SessionManager; class PartialResult; @@ -107,6 +106,4 @@ public: std::unique_ptr makeReply(PartialResultUP full_result); }; -} // namespace proton::matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.cpp b/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.cpp index f6fd7f7cc9d..e456ea5b5a2 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.cpp @@ -1,14 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "session_manager_explorer.h" +#include "sessionmanager.h" #include using vespalib::slime::Inserter; using vespalib::slime::Cursor; using vespalib::StateExplorer; -namespace proton { -namespace matching { +namespace proton::matching { namespace { @@ -59,5 +59,4 @@ SessionManagerExplorer::get_child(vespalib::stringref name) const return std::unique_ptr(nullptr); } -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.h b/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.h index 31dabc5a887..b8acfba0342 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.h +++ b/searchcore/src/vespa/searchcore/proton/matching/session_manager_explorer.h @@ -2,11 +2,11 @@ #pragma once -#include "sessionmanager.h" #include -namespace proton { -namespace matching { +namespace proton::matching { + +class SessionManager; /** * Class used to explore the state of a session manager @@ -20,8 +20,7 @@ public: SessionManagerExplorer(const SessionManager &manager) : _manager(manager) {} virtual void get_state(const vespalib::slime::Inserter &inserter, bool full) const override; virtual std::vector get_children_names() const override; - virtual std::unique_ptr get_child(vespalib::stringref name) const override; + virtual std::unique_ptr get_child(vespalib::stringref name) const override; }; -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h index 2156d853ac4..6773798d2d7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -44,6 +43,8 @@ class IDocumentDBOwner; class MetricsWireService; class StatusReport; +namespace matching { class SessionManager; } + /** * The document database contains all the necessary structures required per * document type. It has an internal single-threaded Executor to process input @@ -110,7 +111,7 @@ private: ProtonConfig::Summary _protonSummaryCfg; ProtonConfig::Index _protonIndexCfg; ConfigStore::UP _config_store; - matching::SessionManager::SP _sessionManager; // TODO: This should not have to be a shared pointer. + std::shared_ptr _sessionManager; // TODO: This should not have to be a shared pointer. MetricsWireService &_metricsWireService; MetricsUpdateHook _metricsHook; vespalib::VarHolder _feedView; 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 c4ff03de6a1..c89a63b95c0 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 @@ -60,8 +60,8 @@ public: }; private: - typedef vespa::config::search::AttributesConfig AttributesConfig; - typedef FastAccessDocSubDBConfigurer Configurer; + using AttributesConfig = vespa::config::search::AttributesConfig; + using Configurer = FastAccessDocSubDBConfigurer; const bool _hasAttributes; const bool _fastAccessAttributesOnly; @@ -81,7 +81,8 @@ private: void initFeedView(const IAttributeWriter::SP &writer, const DocumentDBConfig &configSnapshot); protected: - typedef StoreOnlyDocSubDB Parent; + using Parent = StoreOnlyDocSubDB; + using SessionManagerSP = std::shared_ptr; const bool _addMetrics; MetricsWireService &_metricsWireService; @@ -110,7 +111,7 @@ public: void setup(const DocumentSubDbInitializerResult &initResult) override; void initViews(const DocumentDBConfig &configSnapshot, - const matching::SessionManager::SP &sessionManager) override; + const SessionManagerSP &sessionManager) override; IReprocessingTask::List applyConfig(const DocumentDBConfig &newConfigSnapshot, const DocumentDBConfig &oldConfigSnapshot, diff --git a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp index 0f38e48a8e2..3162f9a1c45 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/matchview.cpp @@ -33,7 +33,7 @@ using matching::SessionManager; MatchView::MatchView(const Matchers::SP &matchers, const IndexSearchable::SP &indexSearchable, const IAttributeManager::SP &attrMgr, - const SessionManager::SP &sessionMgr, + const SessionManagerSP &sessionMgr, const IDocumentMetaStoreContext::SP &metaStore, DocIdLimit &docIdLimit) : _matchers(matchers), @@ -44,6 +44,7 @@ MatchView::MatchView(const Matchers::SP &matchers, _docIdLimit(docIdLimit) { } +MatchView::~MatchView() { } Matcher::SP MatchView::getMatcher(const vespalib::string & rankProfile) const diff --git a/searchcore/src/vespa/searchcore/proton/server/matchview.h b/searchcore/src/vespa/searchcore/proton/server/matchview.h index 5207bce9288..511048f536f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/matchview.h +++ b/searchcore/src/vespa/searchcore/proton/server/matchview.h @@ -8,17 +8,20 @@ #include #include #include -#include #include #include namespace proton { +namespace matching { + class SessionManager; +} class MatchView { + using SessionManagerSP = std::shared_ptr; Matchers::SP _matchers; searchcorespi::IndexSearchable::SP _indexSearchable; IAttributeManager::SP _attrMgr; - matching::SessionManager::SP _sessionMgr; + SessionManagerSP _sessionMgr; IDocumentMetaStoreContext::SP _metaStore; DocIdLimit &_docIdLimit; @@ -34,14 +37,15 @@ public: MatchView(const Matchers::SP &matchers, const searchcorespi::IndexSearchable::SP &indexSearchable, const IAttributeManager::SP &attrMgr, - const matching::SessionManager::SP &sessionMgr, + const SessionManagerSP &sessionMgr, const IDocumentMetaStoreContext::SP &metaStore, DocIdLimit &docIdLimit); + ~MatchView(); const Matchers::SP & getMatchers() const { return _matchers; } const searchcorespi::IndexSearchable::SP & getIndexSearchable() const { return _indexSearchable; } const IAttributeManager::SP & getAttributeManager() const { return _attrMgr; } - const matching::SessionManager::SP & getSessionManager() const { return _sessionMgr; } + const SessionManagerSP & getSessionManager() const { return _sessionMgr; } const IDocumentMetaStoreContext::SP & getDocumentMetaStore() const { return _metaStore; } DocIdLimit & getDocIdLimit() const { return _docIdLimit; } @@ -62,4 +66,3 @@ public: }; } // namespace proton - diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h index 7bd6c1ef100..e790638aa4f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h @@ -126,7 +126,7 @@ public: void initViews(const DocumentDBConfig &configSnapshot, - const matching::SessionManager::SP &sessionManager) override; + const SessionManagerSP &sessionManager) override; IReprocessingTask::List applyConfig(const DocumentDBConfig &newConfigSnapshot, diff --git a/searchcore/src/vespa/searchcore/proton/server/searchview.h b/searchcore/src/vespa/searchcore/proton/server/searchview.h index cb1cd7670bc..186d6154706 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchview.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchview.h @@ -11,6 +11,7 @@ namespace proton { class SearchView : public ISearchHandler { public: + using SessionManagerSP = std::shared_ptr; using IndexSearchable = searchcorespi::IndexSearchable; using InternalDocsumReply = std::pair, bool>; typedef std::shared_ptr SP; @@ -25,7 +26,7 @@ public: const Matchers::SP & getMatchers() const { return _matchView->getMatchers(); } const IndexSearchable::SP & getIndexSearchable() const { return _matchView->getIndexSearchable(); } const IAttributeManager::SP & getAttributeManager() const { return _matchView->getAttributeManager(); } - const matching::SessionManager::SP & getSessionManager() const { return _matchView->getSessionManager(); } + const SessionManagerSP & getSessionManager() const { return _matchView->getSessionManager(); } const IDocumentMetaStoreContext::SP & getDocumentMetaStore() const { return _matchView->getDocumentMetaStore(); } DocIdLimit &getDocIdLimit() const { return _matchView->getDocIdLimit(); } matching::MatchingStats getMatcherStats(const vespalib::string &rankProfile) const { return _matchView->getMatcherStats(rankProfile); } diff --git a/searchlib/src/vespa/searchlib/aggregation/group.h b/searchlib/src/vespa/searchlib/aggregation/group.h index 80db20015d3..32b9696e7f8 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.h +++ b/searchlib/src/vespa/searchlib/aggregation/group.h @@ -64,7 +64,7 @@ public: size_t operator() (const ResultNode & arg) const { return arg.hash(); } }; - typedef std::vector GroupingLevelList; + using GroupingLevelList = std::vector; private: -- cgit v1.2.3