blob: 1bd3a7380bada368bcf6f08d24534c5e9425be6e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "cmdq.h"
#include "config-owner.h"
#include "metrics.h"
#include "model-owner.h"
#include "rpcserver.h"
#include "state-api.h"
#include <vespa/vespalib/net/state_server.h>
namespace config::sentinel {
/**
* Environment for config sentinel, with config
* subscription, rpc server, state server, and
* metrics.
**/
class Env {
public:
Env();
~Env();
ConfigOwner &configOwner() { return _cfgOwner; }
ModelOwner &modelOwner() { return _modelOwner; }
CommandQueue &commandQueue() { return _rpcCommandQueue; }
StartMetrics &metrics() { return _startMetrics; }
void boot(const std::string &configId);
void rpcPort(int portnum);
void statePort(int portnum);
void notifyConfigUpdated();
private:
void respondAsEmpty();
ConfigOwner _cfgOwner;
ModelOwner _modelOwner;
CommandQueue _rpcCommandQueue;
std::unique_ptr<RpcServer> _rpcServer;
StateApi _stateApi;
StartMetrics _startMetrics;
std::unique_ptr<vespalib::StateServer> _stateServer;
int _statePort;
};
}
|