]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Monitor: encode and expose mon command sets
authorGreg Farnum <greg@inktank.com>
Tue, 10 Dec 2013 18:06:36 +0000 (10:06 -0800)
committerGreg Farnum <greg@inktank.com>
Tue, 10 Dec 2013 18:09:24 +0000 (10:09 -0800)
Signed-off-by: Greg Farnum <greg@inktank.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index fce9ece87c101d3ceb6651221d8304445bfe59b7..754fc7ceb2707b14d4086af9ebe1d9599b95a8b1 100644 (file)
@@ -540,6 +540,14 @@ int Monitor::init()
 
   bootstrap();
 
+  // encode command sets
+  const MonCommand *cmds;
+  int cmdsize;
+  get_locally_supported_monitor_commands(&cmds, &cmdsize);
+  MonCommand::encode_array(cmds, cmdsize, supported_commands_bl);
+  get_classic_monitor_commands(&cmds, &cmdsize);
+  MonCommand::encode_array(cmds, cmdsize, classic_commands_bl);
+
   lock.Unlock();
   return 0;
 }
index 7cccb9e9ca5ad8f0fdb54735ee1b36d95a06151e..bde6a2e00bdc5c9a7196e93be0ea5b61115567f5 100644 (file)
@@ -198,6 +198,8 @@ private:
   utime_t leader_since;  // when this monitor became the leader, if it is the leader
   utime_t exited_quorum; // time detected as not in quorum; 0 if in
   uint64_t quorum_features;  ///< intersection of quorum member feature bits
+  bufferlist supported_commands_bl; // encoded MonCommands we support
+  bufferlist classic_commands_bl; // encoded MonCommands supported by Dumpling
 
   set<string> outside_quorum;
 
@@ -535,6 +537,13 @@ public:
                     uint64_t features); // end election (called by Elector)
   void finish_election();
 
+  const bufferlist& get_supported_commands_bl() {
+    return supported_commands_bl;
+  }
+  const bufferlist& get_classic_commands_bl() {
+    return classic_commands_bl;
+  }
+
   void update_logger();
 
   /**