]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: update monstore tool for fsmap, mgrmap 18005/head
authorJohn Spray <john.spray@redhat.com>
Wed, 27 Sep 2017 21:11:24 +0000 (17:11 -0400)
committerJohn Spray <john.spray@redhat.com>
Thu, 28 Sep 2017 10:07:56 +0000 (11:07 +0100)
Fixes: http://tracker.ceph.com/issues/21577
Signed-off-by: John Spray <john.spray@redhat.com>
src/tools/ceph_monstore_tool.cc

index b7a3ea20c7fc68637306a45e50a8b5d8d311fa86..58a8cf386a054dbab0b9da35de23560cc6b31be5 100644 (file)
@@ -28,7 +28,8 @@
 #include "mon/MonitorDBStore.h"
 #include "mon/Paxos.h"
 #include "mon/MonMap.h"
-#include "mds/MDSMap.h"
+#include "mds/FSMap.h"
+#include "mon/MgrMap.h"
 #include "osd/OSDMap.h"
 #include "crush/CrushCompiler.h"
 
@@ -202,6 +203,8 @@ void usage(const char *n, po::options_description &d)
   << "                                  (default: last committed)\n"
   << "  get mdsmap [-- options]         get mdsmap (version VER if specified)\n"
   << "                                  (default: last committed)\n"
+  << "  get mgr [-- options]            get mgr map (version VER if specified)\n"
+  << "                                  (default: last committed)\n"
   << "  get crushmap [-- options]       get crushmap (version VER if specified)\n"
   << "                                  (default: last committed)\n"
   << "  show-versions [-- options]      show the first&last committed version of map\n"
@@ -924,9 +927,16 @@ int main(int argc, char **argv) {
           osdmap.decode(bl);
           osdmap.print(ss);
         } else if (map_type == "mdsmap") {
-          MDSMap mdsmap;
-          mdsmap.decode(bl);
-          mdsmap.print(ss);
+          FSMap fs_map;
+          fs_map.decode(bl);
+          fs_map.print(ss);
+        } else if (map_type == "mgr") {
+          MgrMap mgr_map;
+          auto p = bl.begin();
+          mgr_map.decode(p);
+          JSONFormatter f;
+          f.dump_object("mgrmap", mgr_map);
+          f.flush(ss);
         } else if (map_type == "crushmap") {
           CrushWrapper cw;
           bufferlist::iterator it = bl.begin();
@@ -936,7 +946,7 @@ int main(int argc, char **argv) {
         } else {
           std::cerr << "This type of readable map does not exist: " << map_type
                     << std::endl << "You can only specify[osdmap|monmap|mdsmap"
-                    "|crushmap]" << std::endl;
+                    "|crushmap|mgr]" << std::endl;
         }
       } catch (const buffer::error &err) {
         std::cerr << "Could not decode for human readable output (you may still"