]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mon/MgrMonitor.h
update sources to v12.1.3
[ceph.git] / ceph / src / mon / MgrMonitor.h
index 0dc1af571deeaaf9dcdf50789a5e9d14d823a307..65451633dbefc0aa85c71bd4d65b50e222548922 100644 (file)
 #ifndef CEPH_MGRMONITOR_H
 #define CEPH_MGRMONITOR_H
 
+#include <map>
+#include <set>
+
 #include "include/Context.h"
 #include "MgrMap.h"
 #include "PaxosService.h"
+#include "MonCommand.h"
 
 class MgrMonitor: public PaxosService
 {
@@ -24,6 +28,9 @@ class MgrMonitor: public PaxosService
   MgrMap pending_map;
   bool ever_had_active_mgr = false;
 
+  std::map<std::string, bufferlist> pending_metadata;
+  std::set<std::string>             pending_metadata_rm;
+
   utime_t first_seen_inactive;
 
   std::map<uint64_t, ceph::coarse_mono_clock::time_point> last_beacon;
@@ -45,6 +52,10 @@ class MgrMonitor: public PaxosService
 
   health_status_t should_warn_about_mgr_down();
 
+  // Command descriptions we've learned from the active mgr
+  std::vector<MonCommand> command_descs;
+  std::vector<MonCommand> pending_command_descs;
+
 public:
   MgrMonitor(Monitor *mn, Paxos *p, const string& service_name)
     : PaxosService(mn, p, service_name)
@@ -88,6 +99,14 @@ public:
 
   void print_summary(Formatter *f, std::ostream *ss) const;
 
+  const std::vector<MonCommand> &get_command_descs() const;
+
+  int load_metadata(const string& name, std::map<string, string>& m,
+                   ostream *err);
+  int dump_metadata(const string& name, Formatter *f, ostream *err);
+  void count_metadata(const string& field, Formatter *f);
+  void count_metadata(const string& field, std::map<string,int> *out);
+
   friend class C_Updated;
 };