]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MgrMap: store list of services
authorJohn Spray <john.spray@redhat.com>
Thu, 27 Jul 2017 15:45:53 +0000 (11:45 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:27 +0000 (23:03 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 3f703bd91f07b2fe43a16df0083d7b7c23803fd5)

src/mon/MgrMap.h

index 01ed2515c34a8a811a30feb8b8d5c9f9a90c12fa..1af3a0ee7667e7050cffdb5582fcbf93fdfb13bc 100644 (file)
@@ -77,6 +77,10 @@ public:
   std::set<std::string> modules;
   std::set<std::string> available_modules;
 
+  // Map of module name to URI, indicating services exposed by
+  // running modules on the active mgr daemon.
+  std::map<std::string, std::string> services;
+
   epoch_t get_epoch() const { return epoch; }
   entity_addr_t get_active_addr() const { return active_addr; }
   uint64_t get_active_gid() const { return active_gid; }
@@ -120,7 +124,7 @@ public:
 
   void encode(bufferlist& bl, uint64_t features) const
   {
-    ENCODE_START(2, 1, bl);
+    ENCODE_START(3, 1, bl);
     ::encode(epoch, bl);
     ::encode(active_addr, bl, features);
     ::encode(active_gid, bl);
@@ -129,6 +133,7 @@ public:
     ::encode(standbys, bl);
     ::encode(modules, bl);
     ::encode(available_modules, bl);
+    ::encode(services, bl);
     ENCODE_FINISH(bl);
   }
 
@@ -145,6 +150,9 @@ public:
       ::decode(modules, p);
       ::decode(available_modules, p);
     }
+    if (struct_v >= 3) {
+      ::decode(services, p);
+    }
     DECODE_FINISH(p);
   }
 
@@ -177,6 +185,12 @@ public:
       f->dump_string("module", j);
     }
     f->close_section();
+
+    f->open_object_section("services");
+    for (const auto &i : services) {
+      f->dump_string(i.first.c_str(), i.second);
+    }
+    f->close_section();
   }
 
   static void generate_test_instances(list<MgrMap*> &l) {