]> git.proxmox.com Git - ceph.git/blame - ceph/src/mgr/MgrStandby.h
update sources to 12.2.2
[ceph.git] / ceph / src / mgr / MgrStandby.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2016 John Spray <john.spray@redhat.com>
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 */
13
14
15#ifndef MGR_STANDBY_H_
16#define MGR_STANDBY_H_
17
18#include "auth/Auth.h"
19#include "common/Finisher.h"
20#include "common/Timer.h"
21#include "common/LogClient.h"
22
23#include "client/Client.h"
24#include "mon/MonClient.h"
25#include "osdc/Objecter.h"
3efd9988 26#include "PyModuleRegistry.h"
7c673cae 27
7c673cae
FG
28
29class MMgrMap;
30class Mgr;
31
32class MgrStandby : public Dispatcher,
33 public md_config_obs_t {
34public:
35 // config observer bits
36 const char** get_tracked_conf_keys() const override;
37 void handle_conf_change(const struct md_config_t *conf,
38 const std::set <std::string> &changed) override;
39
40protected:
41 MonClient monc;
42 std::unique_ptr<Messenger> client_messenger;
43 Objecter objecter;
44 Client client;
45
46 LogClient log_client;
47 LogChannelRef clog, audit_clog;
48
49 Mutex lock;
50 SafeTimer timer;
51
3efd9988 52 PyModuleRegistry py_module_registry;
31f18b77
FG
53 std::shared_ptr<Mgr> active_mgr;
54
55 int orig_argc;
56 const char **orig_argv;
7c673cae
FG
57
58 std::string state_str();
59
60 void handle_mgr_map(MMgrMap *m);
61 void _update_log_config();
31f18b77 62 void send_beacon();
7c673cae 63
c07f9fc5
FG
64 bool available_in_map;
65
7c673cae 66public:
31f18b77 67 MgrStandby(int argc, const char **argv);
7c673cae
FG
68 ~MgrStandby() override;
69
70 bool ms_dispatch(Message *m) override;
71 bool ms_handle_reset(Connection *con) override { return false; }
72 void ms_handle_remote_reset(Connection *con) override {}
73 bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
74 bool force_new) override;
75 bool ms_handle_refused(Connection *con) override;
76
77 int init();
78 void shutdown();
31f18b77 79 void respawn();
7c673cae
FG
80 int main(vector<const char *> args);
81 void handle_signal(int signum);
31f18b77 82 void tick();
7c673cae
FG
83};
84
85#endif
86