aboutsummaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/manager.h
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-05-27 13:52:08 +0000
committerArne Juul <arnej@verizonmedia.com>2021-05-27 13:52:08 +0000
commit95e353b52f1c8e34727d7bb385fcc5baf89f481f (patch)
treeaef97bc38a15eddaef04b4612e10c0aaeeea6755 /configd/src/apps/sentinel/manager.h
parente6832404fb93af477d8f3829d7258827d6280a8a (diff)
use environment and bootstrap it before creating manager
Diffstat (limited to 'configd/src/apps/sentinel/manager.h')
-rw-r--r--configd/src/apps/sentinel/manager.h29
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);