]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/PGStatService: implement pre-luminous methods in parent
authorSage Weil <sage@redhat.com>
Sat, 13 May 2017 02:30:43 +0000 (21:30 -0500)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:07 +0000 (13:02 -0400)
Many of these are only needed to support PGMonitor.  Implement those
in the parent and make them ceph_abort() so that the new child can avoid
the clutter.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MgrMonitor.cc
src/mon/PGStatService.h

index da818e2997ad962af3fdd9f85292582c02d2003b..a0c84b56b15e83bc8820b62444038e9c618e0595 100644 (file)
@@ -67,34 +67,14 @@ public:
   const ceph::unordered_map<int32_t,osd_stat_t> *get_osd_stat() const {
     return &parent.osd_stat;
   }
-  const ceph::unordered_map<pg_t,pg_stat_t> *get_pg_stat() const {
-    return &parent.pg_stat;
-  }
-  float get_full_ratio() const { return parent.full_ratio; }
-  float get_nearfull_ratio() const { return parent.nearfull_ratio; }
-
-  bool have_creating_pgs() const { return !parent.creating_pgs.empty(); }
-  bool is_creating_pg(pg_t pgid) const { return parent.creating_pgs.count(pgid); }
-  virtual void maybe_add_creating_pgs(epoch_t scan_epoch,
-                                     creating_pgs_t *pending_creates) const {
-    if (parent.last_pg_scan >= scan_epoch) {
-      for (auto& pgid : parent.creating_pgs) {
-      auto st = parent.pg_stat.find(pgid);
-      assert(st != parent.pg_stat.end());
-      auto created = make_pair(st->second.created, st->second.last_scrub_stamp);
-      // no need to add the pg, if it already exists in creating_pgs
-      pending_creates->pgs.emplace(pgid, created);
-      }
-    }
-  }
-  epoch_t get_min_last_epoch_clean() const { return parent.get_min_last_epoch_clean(); }
 
-  bool have_full_osds() const { return !parent.full_osds.empty(); }
-  bool have_nearfull_osds() const { return !parent.nearfull_osds.empty(); }
-
-  size_t get_num_pg_by_osd(int osd) const { return parent.get_num_pg_by_osd(osd); }
+  size_t get_num_pg_by_osd(int osd) const {
+    return parent.get_num_pg_by_osd(osd);
+  }
 
-  void print_summary(Formatter *f, ostream *out) const { parent.print_summary(f, out); }
+  void print_summary(Formatter *f, ostream *out) const {
+    parent.print_summary(f, out);
+  }
   void dump_fs_stats(stringstream *ss, Formatter *f, bool verbose) const {
     parent.dump_fs_stats(ss, f, verbose);
   }
@@ -102,31 +82,6 @@ public:
                       bool verbose) const {
     parent.dump_pool_stats_full(osdm, ss, f, verbose);
   }
-
-  int process_pg_command(const string& prefix,
-                        const map<string,cmd_vartype>& cmdmap,
-                        const OSDMap& osdmap,
-                        Formatter *f,
-                        stringstream *ss,
-                        bufferlist *odata) {
-    return process_pg_map_command(prefix, cmdmap, parent, osdmap, f, ss, odata);
-  }
-
-  int reweight_by_utilization(const OSDMap &osd_map,
-                             int oload,
-                             double max_changef,
-                             int max_osds,
-                             bool by_pg, const set<int64_t> *pools,
-                             bool no_increasing,
-                             mempool::osdmap::map<int32_t, uint32_t>* new_weights,
-                             std::stringstream *ss,
-                             std::string *out_str,
-                             Formatter *f) {
-    return reweight::by_utilization(osd_map, parent, oload, max_changef,
-                                   max_osds, by_pg, pools, no_increasing,
-                                   new_weights, ss, out_str, f);
-  }
-
 };
 
 
index a23614bfac9e51d823d4770ba96176a6c87e7dd7..b607af70bf97f7449c02614615f599d0f48626a2 100644 (file)
@@ -44,21 +44,39 @@ public:
 
   virtual const osd_stat_t *get_osd_stat(int osd) const = 0;
   virtual const ceph::unordered_map<int32_t,osd_stat_t> *get_osd_stat() const = 0;
-  virtual const ceph::unordered_map<pg_t,pg_stat_t> *get_pg_stat() const = 0;
-  virtual float get_full_ratio() const = 0;
-  virtual float get_nearfull_ratio() const = 0;
-  virtual bool have_creating_pgs() const = 0;
-  virtual bool is_creating_pg(pg_t pgid) const = 0;
+  virtual const ceph::unordered_map<pg_t,pg_stat_t> *get_pg_stat() const {
+    ceph_abort();
+  }
+  virtual float get_full_ratio() const {
+    ceph_abort();
+  }
+  virtual float get_nearfull_ratio() const {
+    ceph_abort();
+  }
+  virtual bool have_creating_pgs() const {
+    ceph_abort();
+  }
+  virtual bool is_creating_pg(pg_t pgid) const {
+    ceph_abort();
+  }
   /**
    * For upgrades. If the PGMap has newer data than the monitor's new
    * creating_pgs (scan_epoch), insert them into the passed pending_creates.
    */
   virtual void maybe_add_creating_pgs(epoch_t scan_epoch,
-                                     creating_pgs_t *pending_creates) const = 0;
-  virtual epoch_t get_min_last_epoch_clean() const = 0;
+                                     creating_pgs_t *pending_creates) const {
+    ceph_abort();
+  }
+  virtual epoch_t get_min_last_epoch_clean() const {
+    ceph_abort();
+  }
 
-  virtual bool have_full_osds() const = 0;
-  virtual bool have_nearfull_osds() const = 0;
+  virtual bool have_full_osds() const {
+    ceph_abort();
+  }
+  virtual bool have_nearfull_osds() const {
+    ceph_abort();
+  }
 
   virtual size_t get_num_pg_by_osd(int osd) const = 0;
   virtual void print_summary(Formatter *f, ostream *out) const = 0;
@@ -71,7 +89,9 @@ public:
                                 const OSDMap& osdmap,
                                 Formatter *f,
                                 stringstream *ss,
-                                bufferlist *odata) = 0;
+                                bufferlist *odata) {
+    ceph_abort();
+  }
 
   virtual int reweight_by_utilization(const OSDMap &osd_map,
                              int oload,
@@ -82,7 +102,9 @@ public:
                              mempool::osdmap::map<int32_t, uint32_t>* new_weights,
                              std::stringstream *ss,
                              std::string *out_str,
-                             Formatter *f) = 0;
+                                     Formatter *f) {
+    ceph_abort();
+  }
 };
 
 #endif