From 879f08be533050935226998773fd1e00c0668d7c Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 16 Oct 2017 15:44:20 +0200 Subject: Remove functionality from pre SPI era. --- .../vespa/searchcore/proton/server/CMakeLists.txt | 1 - .../src/vespa/searchcore/proton/server/ooscli.cpp | 53 ---------------------- .../src/vespa/searchcore/proton/server/ooscli.h | 46 ------------------- .../vespa/searchcore/proton/server/rpc_hooks.cpp | 19 +++++--- .../src/vespa/searchcore/proton/server/rpc_hooks.h | 23 ++++------ 5 files changed, 20 insertions(+), 122 deletions(-) delete mode 100644 searchcore/src/vespa/searchcore/proton/server/ooscli.cpp delete mode 100644 searchcore/src/vespa/searchcore/proton/server/ooscli.h 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 -#include -#include - -#include -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(_orb, params.slobrok_config)), - _oosmanager(std::make_unique(_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 -#include -#include - -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 _sbmirror; - std::unique_ptr _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()), _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 #include -#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 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; -- cgit v1.2.3