]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: added const to dump_* functions in PGMonitor 5299/head
authorhuangjun <hjwsm1989@gmail.com>
Tue, 21 Jul 2015 06:42:33 +0000 (14:42 +0800)
committerhuangjun <hjwsm1989@gmail.com>
Tue, 21 Jul 2015 06:57:48 +0000 (14:57 +0800)
Signed-off-by: huangjun <hjwsm1989@gmail.com>
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/mon/PaxosService.h

index a3eb9340df8e13b18e559805acd1cdd5e8a13e4b..3e2e0cd39f2abd8027367e57d2ab9ad8dd70551a 100644 (file)
@@ -1258,7 +1258,7 @@ inline string percentify(const float& a) {
 //void PGMonitor::dump_object_stat_sum(stringstream& ss, Formatter *f,
 void PGMonitor::dump_object_stat_sum(TextTable &tbl, Formatter *f,
                                     object_stat_sum_t &sum, uint64_t avail,
-                                    bool verbose)
+                                    bool verbose) const
 {
   if (f) {
     f->dump_int("kb_used", SHIFT_ROUND_UP(sum.num_bytes, 10));
@@ -1289,7 +1289,7 @@ void PGMonitor::dump_object_stat_sum(TextTable &tbl, Formatter *f,
   }
 }
 
-int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno)
+int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno) const
 {
   map<int,float> wm;
   int r = osdmap.crush->get_rule_weight_osd_map(ruleno, &wm);
@@ -1412,7 +1412,7 @@ void PGMonitor::dump_pool_stats(stringstream &ss, Formatter *f, bool verbose)
   }
 }
 
-void PGMonitor::dump_fs_stats(stringstream &ss, Formatter *f, bool verbose)
+void PGMonitor::dump_fs_stats(stringstream &ss, Formatter *f, bool verbose) const
 {
   if (f) {
     f->open_object_section("stats");
@@ -1452,7 +1452,7 @@ void PGMonitor::dump_fs_stats(stringstream &ss, Formatter *f, bool verbose)
 }
 
 
-void PGMonitor::dump_info(Formatter *f)
+void PGMonitor::dump_info(Formatter *f) const
 {
   f->open_object_section("pgmap");
   pg_map.dump(f);
index 7e1602522ee5ea6822364df022bbb67f6658a5d6..cb725a67a03c5928885e0525792800dad05a060c 100644 (file)
@@ -148,9 +148,9 @@ private:
   void dump_object_stat_sum(TextTable &tbl, Formatter *f,
                             object_stat_sum_t &sum,
                            uint64_t avail,
-                           bool verbose);
+                           bool verbose) const;
 
-  int64_t get_rule_avail(OSDMap& osdmap, int ruleno);
+  int64_t get_rule_avail(OSDMap& osdmap, int ruleno) const;
 
 public:
   PGMonitor(Monitor *mn, Paxos *p, const string& service_name)
@@ -190,9 +190,9 @@ public:
   void check_osd_map(epoch_t epoch);
 
   void dump_pool_stats(stringstream &ss, Formatter *f, bool verbose);
-  void dump_fs_stats(stringstream &ss, Formatter *f, bool verbose);
+  void dump_fs_stats(stringstream &ss, Formatter *f, bool verbose) const;
 
-  void dump_info(Formatter *f);
+  void dump_info(Formatter *f) const;
 
   int _warn_slow_request_histogram(const pow2_hist_t& h, string suffix,
                                   list<pair<health_status_t,string> >& summary,
index c7f6cf919f93209db9fd66931c8730ca4392f5ac..acfea20fb6c5b0b1ca18f6b2e346d72f70b8e702 100644 (file)
@@ -869,7 +869,7 @@ public:
    *
    * @returns Our first committed version (that is available)
    */
-  version_t get_first_committed() {
+  version_t get_first_committed() const{
     return cached_first_committed;
   }
   /**
@@ -877,7 +877,7 @@ public:
    *
    * @returns Our last committed version
    */
-  version_t get_last_committed() {
+  version_t get_last_committed() const{
     return cached_last_committed;
   }