]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MgrMonitor: s/digest_callback/digest_event/
authorKefu Chai <kchai@redhat.com>
Tue, 16 May 2017 08:41:26 +0000 (16:41 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 16 May 2017 13:50:56 +0000 (21:50 +0800)
to be consistent with the rest of mon

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MgrMonitor.cc
src/mon/MgrMonitor.h

index b36da2fce57c43cfea62901354c8a664abab3f95..1e5f95586893ee731217b18639a704b187477d50 100644 (file)
@@ -263,7 +263,7 @@ void MgrMonitor::check_sub(Subscription *sub)
     }
   } else {
     assert(sub->type == "mgrdigest");
-    if (digest_callback == nullptr) {
+    if (digest_event == nullptr) {
       send_digests();
     }
   }
@@ -275,7 +275,7 @@ void MgrMonitor::check_sub(Subscription *sub)
  */
 void MgrMonitor::send_digests()
 {
-  digest_callback = nullptr;
+  digest_event = nullptr;
 
   const std::string type = "mgrdigest";
   if (mon->session_map.subs.count(type) == 0)
@@ -298,10 +298,10 @@ void MgrMonitor::send_digests()
     sub->session->con->send_message(mdigest);
   }
 
-  digest_callback = new C_MonContext(mon, [this](int){
+  digest_event = new C_MonContext(mon, [this](int){
       send_digests();
   });
-  mon->timer.add_event_after(g_conf->mon_mgr_digest_period, digest_callback);
+  mon->timer.add_event_after(g_conf->mon_mgr_digest_period, digest_event);
 }
 
 void MgrMonitor::on_active()
@@ -538,15 +538,14 @@ bool MgrMonitor::prepare_command(MonOpRequestRef op)
 
 void MgrMonitor::init()
 {
-  if (digest_callback == nullptr) {
+  if (digest_event == nullptr) {
     send_digests();  // To get it to schedule its own event
   }
 }
 
 void MgrMonitor::on_shutdown()
 {
-  if (digest_callback) {
-    mon->timer.cancel_event(digest_callback);
+  if (digest_event) {
+    mon->timer.cancel_event(digest_event);
   }
 }
-
index a582d95b1f6324c1b9f4283676d8990e9e950ada..f4e6f9920d707555239c4ac45fd6e45580a55876 100644 (file)
@@ -36,13 +36,13 @@ class MgrMonitor : public PaxosService
   void drop_active();
   void drop_standby(uint64_t gid);
 
-  Context *digest_callback;
+  Context *digest_event = nullptr;
 
   bool check_caps(MonOpRequestRef op, const uuid_d& fsid);
 
 public:
   MgrMonitor(Monitor *mn, Paxos *p, const string& service_name)
-    : PaxosService(mn, p, service_name), digest_callback(nullptr)
+    : PaxosService(mn, p, service_name)
   {}
 
   void init() override;