summaryrefslogtreecommitdiffstats
path: root/src/mgr/MgrStandby.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/mgr/MgrStandby.h
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/mgr/MgrStandby.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/mgr/MgrStandby.h b/src/mgr/MgrStandby.h
new file mode 100644
index 00000000..7adab68d
--- /dev/null
+++ b/src/mgr/MgrStandby.h
@@ -0,0 +1,89 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2016 John Spray <john.spray@redhat.com>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ */
+
+
+#ifndef MGR_STANDBY_H_
+#define MGR_STANDBY_H_
+
+#include "auth/Auth.h"
+#include "common/Finisher.h"
+#include "common/Timer.h"
+#include "common/LogClient.h"
+
+#include "client/Client.h"
+#include "mon/MonClient.h"
+#include "osdc/Objecter.h"
+#include "PyModuleRegistry.h"
+#include "MgrClient.h"
+
+class MMgrMap;
+class Mgr;
+class PyModuleConfig;
+
+class MgrStandby : public Dispatcher,
+ public md_config_obs_t {
+public:
+ // config observer bits
+ const char** get_tracked_conf_keys() const override;
+ void handle_conf_change(const ConfigProxy& conf,
+ const std::set <std::string> &changed) override;
+
+protected:
+ MonClient monc;
+ std::unique_ptr<Messenger> client_messenger;
+ Objecter objecter;
+ Client client;
+
+ MgrClient mgrc;
+
+ LogClient log_client;
+ LogChannelRef clog, audit_clog;
+
+ Mutex lock;
+ Finisher finisher;
+ SafeTimer timer;
+
+ PyModuleRegistry py_module_registry;
+ std::shared_ptr<Mgr> active_mgr;
+
+ int orig_argc;
+ const char **orig_argv;
+
+ std::string state_str();
+
+ void handle_mgr_map(MMgrMap *m);
+ void _update_log_config();
+ void send_beacon();
+
+ bool available_in_map;
+
+public:
+ MgrStandby(int argc, const char **argv);
+ ~MgrStandby() override;
+
+ bool ms_dispatch(Message *m) override;
+ bool ms_handle_reset(Connection *con) override { return false; }
+ void ms_handle_remote_reset(Connection *con) override {}
+ bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
+ bool ms_handle_refused(Connection *con) override;
+
+ int init();
+ void shutdown();
+ void respawn();
+ int main(vector<const char *> args);
+ void handle_signal(int signum);
+ void tick();
+};
+
+#endif
+