]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Elector:move C_ElectionExpire class to cc file 10416/head
authorMichal Jarzabek <stiopa@gmail.com>
Sun, 24 Jul 2016 09:51:54 +0000 (10:51 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Sun, 24 Jul 2016 09:51:54 +0000 (10:51 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/mon/Elector.cc
src/mon/Elector.h

index 99049a3e93151868ff527ba9bdfd1cbb67e59c3b..b880929777b6ab4f14dd9a311c60215588e8e290 100644 (file)
@@ -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);
index 1c2157eb331c323a8d24f88ff0e9e3e001aefc69..a15445b81a2d2632d7a284f1b69105a3d89b3ecf 100644 (file)
@@ -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.
    *