diff options
Diffstat (limited to 'searchcore')
3 files changed, 9 insertions, 12 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp index a011e4b3512..d974be1ce3a 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp @@ -56,7 +56,7 @@ createScheduler(uint32_t numThreads, uint32_t numSearchPartitions, uint32_t numD ResultProcessor::Result::UP MatchMaster::match(const MatchParams ¶ms, vespalib::ThreadBundle &threadBundle, - const MatchToolsFactory &matchToolsFactory, + const MatchToolsFactory &mtf, ResultProcessor &resultProcessor, uint32_t distributionKey, uint32_t numSearchPartitions) @@ -64,7 +64,7 @@ MatchMaster::match(const MatchParams ¶ms, fastos::StopWatch query_latency_time; query_latency_time.start(); vespalib::DualMergeDirector mergeDirector(threadBundle.size()); - MatchLoopCommunicator communicator(threadBundle.size(), params.heapSize, matchToolsFactory.createDiversifier()); + MatchLoopCommunicator communicator(threadBundle.size(), params.heapSize, mtf.createDiversifier()); TimedMatchLoopCommunicator timedCommunicator(communicator); DocidRangeScheduler::UP scheduler = createScheduler(threadBundle.size(), numSearchPartitions, params.numDocs); @@ -74,9 +74,8 @@ MatchMaster::match(const MatchParams ¶ms, IMatchLoopCommunicator &com = (i == 0) ? static_cast<IMatchLoopCommunicator&>(timedCommunicator) : static_cast<IMatchLoopCommunicator&>(communicator); - threadState.emplace_back(std::make_unique<MatchThread>(i, threadBundle.size(), - params, matchToolsFactory, com, *scheduler, - resultProcessor, mergeDirector, distributionKey)); + threadState.emplace_back(std::make_unique<MatchThread>(i, threadBundle.size(), params, mtf, com, *scheduler, + resultProcessor, mergeDirector, distributionKey)); targets.push_back(threadState.back().get()); } resultProcessor.prepareThreadContextCreation(threadBundle.size()); @@ -95,7 +94,7 @@ MatchMaster::match(const MatchParams ¶ms, _stats.rerankTime(rerank_time_s); _stats.groupingTime(query_time_s - match_time_s); _stats.queries(1); - if (matchToolsFactory.match_limiter().was_limited()) { + if (mtf.match_limiter().was_limited()) { _stats.limited_queries(1); } return reply; diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.h b/searchcore/src/vespa/searchcore/proton/matching/match_master.h index 4c6463cf75d..50f1a94b481 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_master.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.h @@ -25,7 +25,7 @@ public: const MatchingStats & getStats() const { return _stats; } ResultProcessor::Result::UP match(const MatchParams ¶ms, vespalib::ThreadBundle &threadBundle, - const MatchToolsFactory &matchToolsFactory, + const MatchToolsFactory &mtf, ResultProcessor &resultProcessor, uint32_t distributionKey, uint32_t numSearchPartitions); diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp index 8eb135e9a5c..fc4c62353d8 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp @@ -268,8 +268,7 @@ MatchThread::findMatches(MatchTools &tools) tools.setup_second_phase(); DocidRange docid_range = scheduler.total_span(thread_id); tools.search().initRange(docid_range.begin, docid_range.end); - const MatchToolsFactory & mtf = matchToolsFactory; - auto sorted_hit_seq = mtf.should_diversify() + auto sorted_hit_seq = matchToolsFactory.should_diversify() ? hits.getSortedHitSequence(matchParams.arraySize) : hits.getSortedHitSequence(matchParams.heapSize); WaitTimer select_best_timer(wait_time_s); @@ -280,7 +279,7 @@ MatchThread::findMatches(MatchTools &tools) kept_hits.clear(); } uint32_t reRanked = hits.reRank(scorer, std::move(kept_hits)); - if (auto onReRankTask = mtf.createOnReRankTask()) { + if (auto onReRankTask = matchToolsFactory.createOnReRankTask()) { onReRankTask->run(hits.getReRankedHits()); } thread_stats.docsReRanked(reRanked); @@ -349,8 +348,7 @@ MatchThread::processResult(const Doom & hardDoom, } } } - const MatchToolsFactory & mtf = matchToolsFactory; - if (auto onMatchTask = mtf.createOnMatchTask()) { + if (auto onMatchTask = matchToolsFactory.createOnMatchTask()) { onMatchTask->run(search::ResultSet::stealResult(std::move(*result))); } if (hasGrouping) { |