summaryrefslogtreecommitdiffstats
path: root/searchcore/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-12-20 13:03:36 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-12-20 13:03:36 +0000
commit4f84d908c3609b8c8bfc8e186f3e194df83b54a3 (patch)
treece1950fde16e88f9ce4e5129bb871fffcb2c54f9 /searchcore/src
parent1a7551d121e8dfbf9f3accfbb9731628e8968a04 (diff)
Limit exposure of Request. Let Trace be enough.
Diffstat (limited to 'searchcore/src')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp22
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp3
3 files changed, 19 insertions, 13 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
index b16af14fcf5..9c22d43b330 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
@@ -5,7 +5,7 @@
#include <vespa/searchcorespi/index/indexsearchable.h>
#include <vespa/searchlib/fef/indexproperties.h>
#include <vespa/searchlib/fef/ranksetup.h>
-#include <vespa/searchlib/engine/request.h>
+#include <vespa/searchlib/engine/trace.h>
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
#include <vespa/searchlib/attribute/diversity.h>
#include <vespa/searchlib/attribute/attribute_operation.h>
@@ -151,7 +151,9 @@ MatchToolsFactory(QueryLimiter & queryLimiter,
const vespalib::Doom & doom,
ISearchContext & searchContext,
IAttributeContext & attributeContext,
- const search::engine::Request &request,
+ search::engine::Trace & trace,
+ vespalib::stringref queryStack,
+ const vespalib::string & location,
const ViewResolver & viewResolver,
const IDocumentMetaStore & metaStore,
const IIndexEnvironment & indexEnv,
@@ -169,28 +171,28 @@ MatchToolsFactory(QueryLimiter & queryLimiter,
_diversityParams(),
_valid(false)
{
- request.trace().addEvent(4, "MTF: Start");
+ trace.addEvent(4, "MTF: Start");
_query.setWhiteListBlueprint(metaStore.createWhiteListBlueprint());
- request.trace().addEvent(5,"MTF: Build query");
- _valid = _query.buildTree(request.getStackRef(), request.location, viewResolver, indexEnv,
+ trace.addEvent(5,"MTF: Build query");
+ _valid = _query.buildTree(queryStack, location, viewResolver, indexEnv,
rankSetup.split_unpacking_iterators(),
rankSetup.delay_unpacking_iterators());
if (_valid) {
_query.extractTerms(_queryEnv.terms());
_query.extractLocations(_queryEnv.locations());
- request.trace().addEvent(5,"MTF: reserve handles");
+ trace.addEvent(5,"MTF: reserve handles");
_query.reserveHandles(_requestContext, searchContext, _mdl);
_query.optimize();
- request.trace().addEvent(4,"MTF: Fetch Postings");
+ trace.addEvent(4,"MTF: Fetch Postings");
_query.fetchPostings();
_query.freeze();
- request.trace().addEvent(5,"MTF: prepareSharedState");
+ trace.addEvent(5,"MTF: prepareSharedState");
_rankSetup.prepareSharedState(_queryEnv, _queryEnv.getObjectStore());
_diversityParams = extractDiversityParams(_rankSetup, rankProperties);
DegradationParams degradationParams = extractDegradationParams(_rankSetup, rankProperties);
if (degradationParams.enabled()) {
- request.trace().addEvent(5,"MTF: Build MatchPhaseLimiter");
+ trace.addEvent(5,"MTF: Build MatchPhaseLimiter");
_match_limiter = std::make_unique<MatchPhaseLimiter>(metaStore.getCommittedDocIdLimit(), searchContext.getAttributes(),
_requestContext, degradationParams, _diversityParams);
}
@@ -198,7 +200,7 @@ MatchToolsFactory(QueryLimiter & queryLimiter,
if ( ! _match_limiter) {
_match_limiter = std::make_unique<NoMatchPhaseLimiter>();
}
- request.trace().addEvent(4,"MTF: Complete");
+ trace.addEvent(4,"MTF: Complete");
}
MatchToolsFactory::~MatchToolsFactory() = default;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h
index abe31299a17..43288cb18c6 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h
@@ -17,11 +17,12 @@
#include <vespa/vespalib/util/doom.h>
#include <vespa/vespalib/util/clock.h>
+namespace search::engine { class Trace; }
+
namespace search::fef {
class RankProgram;
class RankSetup;
}
-namespace search::engine { class Request; }
namespace proton::matching {
class MatchTools
@@ -110,7 +111,9 @@ public:
const vespalib::Doom & softDoom,
ISearchContext &searchContext,
search::attribute::IAttributeContext &attributeContext,
- const search::engine::Request &request,
+ search::engine::Trace & trace,
+ vespalib::stringref queryStack,
+ const vespalib::string &location,
const ViewResolver &viewResolver,
const search::IDocumentMetaStore &metaStore,
const search::fef::IIndexEnvironment &indexEnv,
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index db1c3f200f7..7fddad326f6 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -153,7 +153,8 @@ Matcher::create_match_tools_factory(const search::engine::Request &request, ISea
_stats.softDoomFactor(), factor, hasFactorOverride, vespalib::count_ns(safeLeft));
}
vespalib::Doom doom(_clock, safeDoom, request.getTimeOfDoom(), hasFactorOverride);
- return std::make_unique<MatchToolsFactory>(_queryLimiter, doom, searchContext, attrContext, request,
+ return std::make_unique<MatchToolsFactory>(_queryLimiter, doom, searchContext, attrContext,
+ request.trace(), request.getStackRef(), request.location,
_viewResolver, metaStore, _indexEnv, *_rankSetup,
rankProperties, feature_overrides);
}