diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-16 15:44:20 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-16 15:44:20 +0200 |
commit | 104329f6b9a2afd46c8cd73b890468cb028e3770 (patch) | |
tree | ead3ec93390307116fb800f2f0d906e362e8b620 /searchcore | |
parent | 39694139a2925d7d32a9858e94c410bae17467ac (diff) |
Remove functionality from pre SPI era.
Diffstat (limited to 'searchcore')
5 files changed, 20 insertions, 122 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt index 5bb512c12ce..508a0208e70 100644 --- a/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt @@ -64,7 +64,6 @@ vespa_add_library(searchcore_server STATIC memoryflush.cpp minimal_document_retriever.cpp move_operation_limiter.cpp - ooscli.cpp operationdonecontext.cpp pendinglidtracker.cpp persistencehandlerproxy.cpp diff --git a/searchcore/src/vespa/searchcore/proton/server/ooscli.cpp b/searchcore/src/vespa/searchcore/proton/server/ooscli.cpp deleted file mode 100644 index e857ded13f0..00000000000 --- a/searchcore/src/vespa/searchcore/proton/server/ooscli.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "ooscli.h" -#include "proton.h" -#include <vespa/slobrok/sbmirror.h> -#include <vespa/messagebus/network/oosmanager.h> -#include <vespa/fnet/frt/supervisor.h> - -#include <vespa/log/log.h> -LOG_SETUP(".proton.server.ooscli"); - -namespace proton { - -OosCli::OosCli(const OosParams ¶ms, FRT_Supervisor &orb) - : FNET_Task(orb.GetScheduler()), - _orb(orb), - _params(params), - _sbmirror(std::make_unique<slobrok::api::MirrorAPI>(_orb, params.slobrok_config)), - _oosmanager(std::make_unique<mbus::OOSManager>(_orb, *_sbmirror, params.oos_server_pattern)), - _curState(-1) -{ - Schedule(0.1); -} - - -OosCli::~OosCli() { - Kill(); // unschedule task -} - -void -OosCli::PerformTask() -{ - int old = _curState; - if (_oosmanager->isOOS(_params.my_oos_name)) { - _params.proton.getMatchEngine().setOutOfService(); - _curState = 0; - if (_curState != old) { - LOG(warning, "this search engine (messagebus name '%s') is Out Of Service", - _params.my_oos_name.c_str()); - } - } else { - if (_params.proton.isReplayDone()) { - _params.proton.getMatchEngine().setInService(); - _curState = 1; - } - if (_curState != old) { - LOG(info, "search engine is In Service, setting online"); - } - } - Schedule(1.0); -} - -} // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/ooscli.h b/searchcore/src/vespa/searchcore/proton/server/ooscli.h deleted file mode 100644 index 8de1cfcd68d..00000000000 --- a/searchcore/src/vespa/searchcore/proton/server/ooscli.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include <vespa/fnet/task.h> -#include <vespa/vespalib/stllike/string.h> -#include <vespa/config/subscription/configuri.h> - -class FRT_Supervisor; - -namespace mbus { class OOSManager; } -namespace slobrok { namespace api { class IMirrorAPI; }} -namespace proton { - -class Proton; - -class OosCli : public FNET_Task -{ -public: - struct OosParams { - Proton &proton; - vespalib::string oos_server_pattern; - vespalib::string my_oos_name; - config::ConfigUri slobrok_config; - - OosParams(Proton &p) - : proton(p), - oos_server_pattern("search/cluster.*/rtx/*/*"), - my_oos_name(), - slobrok_config(config::ConfigUri("admin/slobrok.0")) - {} - }; -private: - FRT_Supervisor & _orb; - OosParams _params; - std::unique_ptr<slobrok::api::IMirrorAPI> _sbmirror; - std::unique_ptr<mbus::OOSManager> _oosmanager; - int _curState; -public: - OosCli(const OosParams ¶ms, FRT_Supervisor &orb); - virtual ~OosCli(); - virtual void PerformTask() override; -}; - -} // namespace proton - diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp index 0595cb5d983..7f6fdf0e06f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp @@ -189,15 +189,22 @@ RPCHooksBase::initRPC() } +RPCHooksBase::Params::Params(Proton &parent, uint32_t port, const vespalib::string &ident) + : proton(parent), + slobrok_config(config::ConfigUri("admin/slobrok.0")), + identity(ident), + rtcPort(port) +{ } + +RPCHooksBase::Params::~Params() = default; + RPCHooksBase::RPCHooksBase(Params ¶ms) : _proton(params.proton), _docsumByRPC(new DocsumByRPC(_proton.getDocsumBySlime())), _orb(std::make_unique<FRT_Supervisor>()), _regAPI(*_orb, params.slobrok_config), - _executor(48, 128 * 1024), - _ooscli(params, *_orb) -{ -} + _executor(48, 128 * 1024) +{ } void RPCHooksBase::open(Params & params) @@ -209,9 +216,7 @@ RPCHooksBase::open(Params & params) LOG(debug, "started monitoring interface"); } -RPCHooksBase::~RPCHooksBase() -{ -} +RPCHooksBase::~RPCHooksBase() = default; void RPCHooksBase::close() diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h index 19cf6c9c4c3..ab5980a39fa 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.h @@ -9,8 +9,6 @@ #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/searchlib/common/packets.h> -#include "ooscli.h" - namespace proton { class Proton; @@ -65,7 +63,6 @@ private: slobrok::api::RegisterAPI _regAPI; vespalib::Monitor _stateMonitor; vespalib::ThreadStackExecutor _executor; - OosCli _ooscli; void initRPC(); void letProtonDo(vespalib::Closure::UP closure); @@ -82,18 +79,14 @@ private: static const Session::SP & getSession(FRT_RPCRequest *req); public: typedef std::unique_ptr<RPCHooksBase> UP; - struct Params : public OosCli::OosParams { - vespalib::string identity; - uint32_t rtcPort; - - Params(Proton &parent, uint32_t port, const vespalib::string &ident) - : OosParams(parent), - identity(ident), - rtcPort(port) - { - my_oos_name = identity; - my_oos_name.append("/feed-destination"); - } + struct Params { + Proton &proton; + config::ConfigUri slobrok_config; + vespalib::string identity; + uint32_t rtcPort; + + Params(Proton &parent, uint32_t port, const vespalib::string &ident); + ~Params(); }; RPCHooksBase(const RPCHooksBase &) = delete; RPCHooksBase & operator = (const RPCHooksBase &) = delete; |