summaryrefslogtreecommitdiffstats
path: root/src/mgr/MgrStandby.h
diff options
context:
space:
mode:
authorJohn Spray <john.spray@redhat.com>2016-07-15 01:39:22 +0200
committerJohn Spray <john.spray@redhat.com>2016-09-29 18:26:58 +0200
commit7845f8d757adf63390d6cb0ff56afbc088bc508b (patch)
tree72043a3958d542e202a4b945e67c2a4b79f07807 /src/mgr/MgrStandby.h
parentpybind/mgr: implement shutdown() in rest.py (diff)
downloadceph-7845f8d757adf63390d6cb0ff56afbc088bc508b.tar.xz
ceph-7845f8d757adf63390d6cb0ff56afbc088bc508b.zip
mgr: flesh out standby/HA
Signed-off-by: John Spray <john.spray@redhat.com>
Diffstat (limited to 'src/mgr/MgrStandby.h')
-rw-r--r--src/mgr/MgrStandby.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/mgr/MgrStandby.h b/src/mgr/MgrStandby.h
new file mode 100644
index 00000000000..ccb44d74b71
--- /dev/null
+++ b/src/mgr/MgrStandby.h
@@ -0,0 +1,60 @@
+// -*- 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 "DaemonServer.h"
+#include "PyModules.h"
+
+#include "DaemonState.h"
+#include "ClusterState.h"
+
+class Mgr;
+
+class MgrStandby : public Dispatcher {
+protected:
+ MonClient *monc;
+ Messenger *client_messenger;
+
+ Mutex lock;
+ SafeTimer timer;
+
+ Mgr *active_mgr;
+
+ std::string state_str();
+
+public:
+ MgrStandby();
+ ~MgrStandby();
+
+ bool ms_dispatch(Message *m);
+ bool ms_handle_reset(Connection *con) { return false; }
+ void ms_handle_remote_reset(Connection *con) {}
+ bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
+ bool force_new);
+ int init();
+ void shutdown();
+ void usage() {}
+ int main(vector<const char *> args);
+ void handle_signal(int signum);
+ void send_beacon();
+};
+
+#endif
+