summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-03-07 00:37:52 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-03-07 00:37:52 +0000
commit85371fa5da72ab4c2724e1fd9f1aec79c472f751 (patch)
treedfad4716e36f7f5327ee0fc8bbbbd801b7c432f8 /searchcore
parenta1c4e2e81735828d42ccf541b28e2a06db803e88 (diff)
Put distribution-key in trace payload and name it 'trace'.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
index 0cb50fb00b0..3a28eeb4dfd 100644
--- a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
@@ -50,7 +50,6 @@ MatchEngine::MatchEngine(size_t numThreads, size_t threadsPerSearch, uint32_t di
_threadBundlePool(std::max(size_t(1), threadsPerSearch)),
_nodeUp(false)
{
- // empty
}
MatchEngine::~MatchEngine()
@@ -106,9 +105,7 @@ MatchEngine::search(search::engine::SearchRequest::Source request,
return ret;
}
- vespalib::Executor::Task::UP task;
- task.reset(new SearchTask(*this, std::move(request), client));
- _executor.execute(std::move(task));
+ _executor.execute(std::make_unique<SearchTask>(*this, std::move(request), client));
return search::engine::SearchReply::UP();
}
@@ -144,11 +141,10 @@ MatchEngine::performSearch(search::engine::SearchRequest::Source req,
ret->request = req.release();
ret->setDistributionKey(_distributionKey);
if (ret->request->getTraceLevel() > 0) {
- vespalib::asciistream os;
- os << "trace-" << _distributionKey;
- search::fef::Properties & trace = ret->propertiesMap.lookupCreate(os.str());
+ ret->request->trace().getRoot().setLong("distribution-key", _distributionKey);
+ search::fef::Properties & trace = ret->propertiesMap.lookupCreate("trace");
vespalib::SmartBuffer output(4096);
- vespalib::slime::BinaryFormat::encode(ret->request->trace().getRoot(), output);
+ vespalib::slime::BinaryFormat::encode(ret->request->trace().getSlime(), output);
trace.add("slime", output.obtain().make_stringref());
}
client.searchDone(std::move(ret));