diff options
author | Håvard Pettersen <havardpe@oath.com> | 2019-03-07 09:42:31 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2019-03-25 13:35:53 +0000 |
commit | 287b425e61cb40584991729bf2f4234d27d85cc8 (patch) | |
tree | 8ba4e95cfe3b5a212b4d422f956f88a7aee43700 /searchcore/src | |
parent | e957b28c666a6b0d45fc325efc11e894f7d63d94 (diff) |
initial searchprotocol implementation in cpp
Diffstat (limited to 'searchcore/src')
5 files changed, 31 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp index f59bad95343..4157fa221ab 100644 --- a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp +++ b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp @@ -118,7 +118,7 @@ MatchEngine::performSearch(search::engine::SearchRequest::Source req, const search::engine::SearchRequest * searchRequest = req.get(); if (searchRequest) { // 3 is the minimum level required for backend tracing. - searchRequest->setTraceLevel(search::fef::indexproperties::trace::Level::lookup(searchRequest->propertiesMap.modelOverrides()), 3); + searchRequest->setTraceLevel(search::fef::indexproperties::trace::Level::lookup(searchRequest->propertiesMap.modelOverrides(), searchRequest->getTraceLevel()), 3); ISearchHandler::SP searchHandler; vespalib::SimpleThreadBundle::UP threadBundle = _threadBundlePool.obtain(); { // try to find the match handler corresponding to the specified search doc type diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 978720f88ae..8aef8d51c5f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -482,6 +482,23 @@ size_t Proton::getNumActiveDocs() const return numDocs; } +search::engine::SearchServer & +Proton::get_search_server() +{ + return *_matchEngine; +} + +search::engine::DocsumServer & +Proton::get_docsum_server() +{ + return *_summaryEngine; +} + +search::engine::MonitorServer & +Proton::get_monitor_server() +{ + return *this; +} vespalib::string Proton::getDelayedConfigs() const @@ -631,6 +648,7 @@ Proton::ping(MonitorRequest::UP request, MonitorClient & client) BootstrapConfig::SP configSnapshot = getActiveConfigSnapshot(); const ProtonConfig &protonConfig = configSnapshot->getProtonConfig(); ret.partid = protonConfig.partition; + ret.distribution_key = protonConfig.distributionkey; ret.timestamp = (_matchEngine->isOnline()) ? 42 : 0; ret.activeDocs = getNumActiveDocs(); ret.activeDocsRequested = request->reportActiveDocs; diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.h b/searchcore/src/vespa/searchcore/proton/server/proton.h index 14ddcee3d5c..fe7e8fe2219 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.h +++ b/searchcore/src/vespa/searchcore/proton/server/proton.h @@ -194,6 +194,10 @@ public: size_t getNumActiveDocs() const; DocsumBySlime & getDocsumBySlime() { return *_docsumBySlime; } + search::engine::SearchServer &get_search_server(); + search::engine::DocsumServer &get_docsum_server(); + search::engine::MonitorServer &get_monitor_server(); + vespalib::string getDelayedConfigs() const; StatusReport::List getStatusReports() const override; diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp index 3e00bdeb370..2d63f192189 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp @@ -196,6 +196,10 @@ RPCHooksBase::RPCHooksBase(Params ¶ms) : _proton(params.proton), _docsumByRPC(new DocsumByRPC(_proton.getDocsumBySlime())), _orb(std::make_unique<FRT_Supervisor>()), + _proto_rpc_adapter(std::make_unique<ProtoRpcAdapter>( + _proton.get_search_server(), + _proton.get_docsum_server(), + _proton.get_monitor_server(), *_orb)), _regAPI(*_orb, params.slobrok_config), _stateLock(), _stateCond(), diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h index 057706e3d97..ad0a69fcd55 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h @@ -8,6 +8,7 @@ #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/searchlib/common/packets.h> +#include <vespa/searchlib/engine/proto_rpc_adapter.h> #include <mutex> #include <condition_variable> @@ -19,6 +20,8 @@ class DocsumByRPC; class RPCHooksBase : public FRT_Invokable { private: + using ProtoRpcAdapter = search::engine::ProtoRpcAdapter; + class Session { private: fastos::TimeStamp _createTime; @@ -62,6 +65,7 @@ private: Proton & _proton; std::unique_ptr<DocsumByRPC> _docsumByRPC; std::unique_ptr<FRT_Supervisor> _orb; + std::unique_ptr<ProtoRpcAdapter> _proto_rpc_adapter; slobrok::api::RegisterAPI _regAPI; std::mutex _stateLock; std::condition_variable _stateCond; |