From: Michal Jarzabek Date: Sun, 24 Jul 2016 09:51:54 +0000 (+0100) Subject: mon/Elector:move C_ElectionExpire class to cc file X-Git-Tag: v11.0.1~200^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c819596e59fd5f66b3258fedd1d10b20cf70f0a9;p=ceph.git mon/Elector:move C_ElectionExpire class to cc file Signed-off-by: Michal Jarzabek --- diff --git a/src/mon/Elector.cc b/src/mon/Elector.cc index 99049a3e9315..b880929777b6 100644 --- a/src/mon/Elector.cc +++ b/src/mon/Elector.cc @@ -126,6 +126,27 @@ void Elector::defer(int who) void Elector::reset_timer(double plus) { + /** + * This class is used as the callback when the expire_event timer fires up. + * + * If the expire_event is fired, then it means that we had an election going, + * either started by us or by some other participant, but it took too long, + * thus expiring. + * + * When the election expires, we will check if we were the ones who won, and + * if so we will declare victory. If that is not the case, then we assume + * that the one we defered to didn't declare victory quickly enough (in fact, + * as far as we know, we may even be dead); so, just propose ourselves as the + * Leader. + */ + class C_ElectionExpire : public Context { + Elector *elector; + public: + explicit C_ElectionExpire(Elector *e) : elector(e) { } + void finish(int r) { + elector->expire(); + } + }; // set the timer cancel_timer(); expire_event = new C_ElectionExpire(this); diff --git a/src/mon/Elector.h b/src/mon/Elector.h index 1c2157eb331c..a15445b81a2d 100644 --- a/src/mon/Elector.h +++ b/src/mon/Elector.h @@ -145,35 +145,6 @@ class Elector { */ void bump_epoch(epoch_t e); - /** - * @defgroup Elector_h_callbacks Callbacks - * @{ - */ - /** - * This class is used as the callback when the expire_event timer fires up. - * - * If the expire_event is fired, then it means that we had an election going, - * either started by us or by some other participant, but it took too long, - * thus expiring. - * - * When the election expires, we will check if we were the ones who won, and - * if so we will declare victory. If that is not the case, then we assume - * that the one we defered to didn't declare victory quickly enough (in fact, - * as far as we know, we may even be dead); so, just propose ourselves as the - * Leader. - */ - class C_ElectionExpire : public Context { - Elector *elector; - public: - explicit C_ElectionExpire(Elector *e) : elector(e) { } - void finish(int r) { - elector->expire(); - } - }; - /** - * @} - */ - /** * Start new elections by proposing ourselves as the new Leader. *