]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: move creating_pgs and reweight_by_utilization into new MonPGStatService
authorGreg Farnum <gfarnum@redhat.com>
Fri, 9 Jun 2017 22:42:47 +0000 (15:42 -0700)
committerNathan Cutler <ncutler@suse.com>
Wed, 14 Jun 2017 07:35:47 +0000 (09:35 +0200)
Use that throughout the monitor code, so that we can use the
PGStatService elsewhere.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit 9812319616056a92750d3c89151445353f0fb501)

src/mon/MgrMonitor.h
src/mon/MgrStatMonitor.cc
src/mon/MgrStatMonitor.h
src/mon/Monitor.h
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/mon/PGStatService.h

index 33981c705c89e32e76244f627b1e32ec7f8fba31..a09e10919321e18413a451d31386e676d5310d36 100644 (file)
@@ -18,7 +18,7 @@
 #include "MgrMap.h"
 #include "PaxosService.h"
 
-class PGStatService;
+class MonPGStatService;
 
 class MgrMonitor: public PaxosService
 {
index b82ce6084ceeee930d51a2f79984ffd90c5ca674..9245219f048f7c16eade123fa9aa4c14f867973d 100644 (file)
@@ -11,7 +11,7 @@
 #include "messages/MStatfs.h"
 #include "messages/MStatfsReply.h"
 
-class MgrPGStatService : public PGStatService {
+class MgrPGStatService : public MonPGStatService {
   PGMapDigest& digest;
 public:
   MgrPGStatService(PGMapDigest& d) : digest(d) {}
@@ -63,7 +63,7 @@ MgrStatMonitor::MgrStatMonitor(Monitor *mn, Paxos *p, const string& service_name
 
 MgrStatMonitor::~MgrStatMonitor() = default;
 
-PGStatService *MgrStatMonitor::get_pg_stat_service()
+MonPGStatService *MgrStatMonitor::get_pg_stat_service()
 {
   return pgservice.get();
 }
index c6e4bea0c95f88da57264bcad7db939c86054e22..7ecbc9d377f5d53d6528109bba305f343790ee07 100644 (file)
@@ -7,7 +7,7 @@
 #include "PaxosService.h"
 #include "mon/PGMap.h"
 
-class PGStatService;
+class MonPGStatService;
 class MgrPGStatService;
 
 class MgrStatMonitor : public PaxosService {
@@ -65,7 +65,7 @@ public:
 
   void print_summary(Formatter *f, std::ostream *ss) const;
 
-  PGStatService *get_pg_stat_service();
+  MonPGStatService *get_pg_stat_service();
 
   friend class C_Updated;
 };
index 0d3a9080e812c560de47e2cfd7df1dedf704e438..c2fdae7af8c711359cae83ce6135893b132f3056 100644 (file)
@@ -170,7 +170,7 @@ public:
   MgrClient mgr_client;
   uint64_t mgr_proxy_bytes = 0;  // in-flight proxied mgr command message bytes
 
-  const PGStatService *pgservice;
+  const MonPGStatService *pgservice;
 
 private:
   void new_tick();
index fc46cbf92d0698071ff77232fff926bec9cbb7cf..41aea591cfe02dcd54f3bb6910d3e7dec802d330 100644 (file)
@@ -1169,7 +1169,7 @@ bool PGMonitor::check_sub(Subscription *sub)
   return true;
 }
 
-class PGMapStatService : public PGStatService {
+class PGMapStatService : public MonPGStatService {
   const PGMap& pgmap;
   PGMonitor *pgmon;
 public:
@@ -1308,7 +1308,7 @@ public:
   }
 };
 
-PGStatService *PGMonitor::get_pg_stat_service()
+MonPGStatService *PGMonitor::get_pg_stat_service()
 {
   if (!pgservice) {
     pgservice.reset(new PGMapStatService(pg_map, this));
index 0e2171d3ebce1154cd548a584e6d5bd3ed34bdaa..c025bfff994b7708b115c6bfccd0d9464e2f6363 100644 (file)
@@ -33,11 +33,11 @@ using namespace std;
 #include "mon/MonitorDBStore.h"
 
 class MPGStats;
-class PGStatService;
+class MonPGStatService;
 
 class PGMonitor : public PaxosService {
   PGMap pg_map;
-  std::unique_ptr<PGStatService> pgservice;
+  std::unique_ptr<MonPGStatService> pgservice;
 
   bool do_delete = false;   ///< propose deleting pgmap data
   bool did_delete = false;  ///< we already deleted pgmap data
@@ -131,7 +131,7 @@ public:
   void check_subs();
   bool check_sub(Subscription *sub);
 
-  PGStatService *get_pg_stat_service();
+  MonPGStatService *get_pg_stat_service();
 
 private:
   // no copying allowed
index ee1b9856775c4674bcf556d1e4dc15df180715d4..4fe3b11870957e4ad9f9f1876ac3580d6e2f86cb 100644 (file)
@@ -59,24 +59,6 @@ public:
   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 unsigned maybe_add_creating_pgs(epoch_t scan_epoch,
-     const mempool::osdmap::map<int64_t,pg_pool_t>& pools,
-     creating_pgs_t *pending_creates) const {
-    ceph_abort();
-    return 0;
-  }
-  /**
-   * For upgrades. If some PGs are created before all OSDs are luminous
-   * and start sending MOSDPGCreated, we need to be sync with pgmap
-   *
-   */
-  virtual void maybe_trim_creating_pgs(creating_pgs_t *creates) const {
-    ceph_abort();
-  }
   virtual epoch_t get_min_last_epoch_clean() const {
     ceph_abort();
   }
@@ -107,6 +89,30 @@ public:
     ceph_abort();
   }
 
+};
+
+class MonPGStatService : public PGStatService {
+public:
+  MonPGStatService() : PGStatService() {}
+  virtual ~MonPGStatService() {}
+  /**
+   * 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 unsigned maybe_add_creating_pgs(epoch_t scan_epoch,
+     const mempool::osdmap::map<int64_t,pg_pool_t>& pools,
+     creating_pgs_t *pending_creates) const {
+    ceph_abort();
+    return 0;
+  }
+  /**
+   * For upgrades. If some PGs are created before all OSDs are luminous
+   * and start sending MOSDPGCreated, we need to be sync with pgmap
+   *
+   */
+  virtual void maybe_trim_creating_pgs(creating_pgs_t *creates) const {
+    ceph_abort();
+  }
   virtual int reweight_by_utilization(const OSDMap &osd_map,
                              int oload,
                              double max_changef,