diff options
Diffstat (limited to 'configd/src/apps/sentinel/manager.h')
-rw-r--r-- | configd/src/apps/sentinel/manager.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/configd/src/apps/sentinel/manager.h b/configd/src/apps/sentinel/manager.h index e157d5e003d..dabe1590d20 100644 --- a/configd/src/apps/sentinel/manager.h +++ b/configd/src/apps/sentinel/manager.h @@ -1,11 +1,12 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include "service.h" -#include "metrics.h" -#include "state-api.h" #include "cmdq.h" +#include "env.h" +#include "metrics.h" #include "rpcserver.h" +#include "service.h" +#include "state-api.h" #include <vespa/config-sentinel.h> #include <vespa/config/config.h> #include <vespa/vespalib/net/state_server.h> @@ -31,20 +32,13 @@ class Manager { private: typedef std::map<vespalib::string, Service::UP> ServiceMap; - ConfigSubscriber _subscriber; - ConfigHandle<SentinelConfig>::UP _sentinelHandle; + Env &_env; ServiceMap _services; ServiceMap _orphans; std::list<OutputConnection *> _outputConnections; - CommandQueue _cmdQ; - std::unique_ptr<RpcServer> _rpcServer; - int _boundPort; - StartMetrics _startMetrics; - StateApi _stateApi; - std::unique_ptr<vespalib::StateServer> _stateServer; - Manager(const Manager&); - Manager& operator =(const Manager&); + Manager(const Manager&) = delete; + Manager& operator =(const Manager&) = delete; Service *serviceByPid(pid_t pid); Service *serviceByName(const vespalib::string & name); @@ -54,19 +48,14 @@ private: void handleChildDeaths(); void handleRestarts(); - static int listen(int port); - void configure_port(int port); - void updateMetrics(); void terminateServices(bool catchable, bool printDebug = false); - void doConfigure(); - public: - Manager(); + Manager(Env &env); virtual ~Manager(); - void subscribe(const std::string & configId, std::chrono::milliseconds timeout); + void doConfigure(); bool terminate(); int doWork(); void updateActiveFdset(fd_set *fds, int *maxNum); |