]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: node ls improvement 20820/head
authorGu Zhongyan <guzhongyan@360.cn>
Fri, 9 Mar 2018 10:06:29 +0000 (18:06 +0800)
committerGu Zhongyan <guzhongyan@360.cn>
Fri, 9 Mar 2018 10:08:31 +0000 (18:08 +0800)
output mon/mds name instead of their rank

Signed-off-by: Gu Zhongyan <guzhongyan@360.cn>
src/mon/MDSMonitor.cc
src/mon/Monitor.cc

index 387f4706cd4ae3bb6357800adedff8c3f0097ec3..14c5e10511825716d609cecce49e30649e466d72 100644 (file)
@@ -1735,7 +1735,7 @@ int MDSMonitor::print_nodes(Formatter *f)
     return r;
   }
 
-  map<string, list<int> > mdses; // hostname => rank
+  map<string, list<string> > mdses; // hostname => mds
   for (map<mds_gid_t, Metadata>::iterator it = metadata.begin();
        it != metadata.end(); ++it) {
     const Metadata& m = it->second;
@@ -1750,8 +1750,7 @@ int MDSMonitor::print_nodes(Formatter *f)
       continue;
     }
     const MDSMap::mds_info_t& mds_info = fsmap.get_info_gid(gid);
-    // FIXME: include filesystem name with rank here
-    mdses[hostname->second].push_back(mds_info.rank);
+    mdses[hostname->second].push_back(mds_info.name);
   }
 
   dump_services(f, mdses, "mds");
index 74866fa4a2f99d6508cbbde0d95d4e50fe5e1274..ac319fe39400c201139e96b7cc953779df45577b 100644 (file)
@@ -4969,7 +4969,7 @@ void Monitor::count_metadata(const string& field, Formatter *f)
 
 int Monitor::print_nodes(Formatter *f, ostream& err)
 {
-  map<string, list<int> > mons;        // hostname => mon
+  map<string, list<string> > mons;     // hostname => mon
   for (map<int, Metadata>::iterator it = mon_metadata.begin();
        it != mon_metadata.end(); ++it) {
     const Metadata& m = it->second;
@@ -4978,7 +4978,7 @@ int Monitor::print_nodes(Formatter *f, ostream& err)
       // not likely though
       continue;
     }
-    mons[hostname->second].push_back(it->first);
+    mons[hostname->second].push_back(monmap->get_name(it->first));
   }
 
   dump_services(f, mons, "mon");