]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/messages/MMgrBeacon.h
update sources to v12.1.2
[ceph.git] / ceph / src / messages / MMgrBeacon.h
index ab55a9642a216a1dc8585524f4acc1a42f8179e1..c877afc152438491cc6f4c150dfd0da6accf8fef 100644 (file)
 #define CEPH_MMGRBEACON_H
 
 #include "messages/PaxosServiceMessage.h"
+#include "mon/MonCommand.h"
 
 #include "include/types.h"
 
 
 class MMgrBeacon : public PaxosServiceMessage {
 
-  static const int HEAD_VERSION = 3;
+  static const int HEAD_VERSION = 5;
   static const int COMPAT_VERSION = 1;
 
 protected:
@@ -32,6 +33,10 @@ protected:
   std::string name;
   uuid_d fsid;
   std::set<std::string> available_modules;
+  map<string,string> metadata; ///< misc metadata about this osd
+
+  // Only populated during activation
+  std::vector<MonCommand> command_descs;
 
 public:
   MMgrBeacon()
@@ -42,10 +47,11 @@ public:
 
   MMgrBeacon(const uuid_d& fsid_, uint64_t gid_, const std::string &name_,
              entity_addr_t server_addr_, bool available_,
-            const std::set<std::string>& module_list)
+            const std::set<std::string>& module_list,
+            map<string,string>&& metadata)
     : PaxosServiceMessage(MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
       gid(gid_), server_addr(server_addr_), available(available_), name(name_),
-      fsid(fsid_), available_modules(module_list)
+      fsid(fsid_), available_modules(module_list), metadata(std::move(metadata))
   {
   }
 
@@ -55,6 +61,19 @@ public:
   const std::string& get_name() const { return name; }
   const uuid_d& get_fsid() const { return fsid; }
   std::set<std::string>& get_available_modules() { return available_modules; }
+  const std::map<std::string,std::string>& get_metadata() const {
+    return metadata;
+  }
+
+  void set_command_descs(const std::vector<MonCommand> &cmds)
+  {
+    command_descs = cmds;
+  }
+
+  const std::vector<MonCommand> &get_command_descs()
+  {
+    return command_descs;
+  }
 
 private:
   ~MMgrBeacon() override {}
@@ -77,6 +96,8 @@ public:
     ::encode(name, payload);
     ::encode(fsid, payload);
     ::encode(available_modules, payload);
+    ::encode(command_descs, payload);
+    ::encode(metadata, payload);
   }
   void decode_payload() override {
     bufferlist::iterator p = payload.begin();
@@ -91,6 +112,12 @@ public:
     if (header.version >= 3) {
       ::decode(available_modules, p);
     }
+    if (header.version >= 4) {
+      ::decode(command_descs, p);
+    }
+    if (header.version >= 5) {
+      ::decode(metadata, p);
+    }
   }
 };