]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: remove last trace of PGMap from MgrMonitor
authorKefu Chai <kchai@redhat.com>
Mon, 15 May 2017 13:46:32 +0000 (21:46 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:08 +0000 (13:02 -0400)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MgrMonitor.cc
src/mon/MgrMonitor.h

index 761d2378874cd4939c300cb16fc5cbb9ad92bae3..f1ce7f53447532c7db3679639e5fb6343356df88 100644 (file)
@@ -16,7 +16,6 @@
 #include "messages/MMgrDigest.h"
 #include "messages/MMonMgrReport.h"
 
-#include "PGMap.h"
 #include "PGStatService.h"
 #include "include/stringify.h"
 #include "mgr/MgrContext.h"
@@ -35,7 +34,7 @@ static ostream& _prefix(std::ostream *_dout, Monitor *mon,
 }
 
 
-class MgrPGStatService : public PGMap, public PGStatService {
+class MgrPGStatService : public PGStatService {
   PGMapDigest digest;
 public:
   void decode_digest(bufferlist& bl) {
@@ -674,15 +673,11 @@ void MgrMonitor::on_shutdown()
   cancel_timer();
 }
 
-MgrMonitor::~MgrMonitor()
-{
-  delete pgservice;
-}
 
 PGStatService *MgrMonitor::get_pg_stat_service()
 {
   if (!pgservice) {
-    pgservice = new MgrPGStatService();
+    pgservice.reset(new MgrPGStatService());
   }
-  return pgservice;
+  return pgservice.get();
 }
index f53f5b08f6a525c0621a4fbeed9bc62f970a86b0..d14d400ab1d23d36210da8ce8d89532193c60727 100644 (file)
@@ -28,7 +28,7 @@ class MgrMonitor: public PaxosService
 
   utime_t first_seen_inactive;
 
-  MgrPGStatService *pgservice = nullptr;
+  std::unique_ptr<MgrPGStatService> pgservice;
 
   std::map<uint64_t, ceph::coarse_mono_clock::time_point> last_beacon;
 
@@ -50,9 +50,8 @@ class MgrMonitor: public PaxosService
 public:
   MgrMonitor(Monitor *mn, Paxos *p, const string& service_name)
     : PaxosService(mn, p, service_name)
-    : PaxosService(mn, p, service_name)
   {}
-  ~MgrMonitor() override;
+  ~MgrMonitor() override {}
 
   void init() override;
   void on_shutdown() override;