]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: organize Beacon class members
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 10 Nov 2016 23:51:27 +0000 (18:51 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 21 Nov 2016 21:40:54 +0000 (16:40 -0500)
This amends the code to follow our C++ style guidelines with the goal of
increasing header readability.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Beacon.cc
src/mds/Beacon.h

index 24525df6614e356f4df6f70cfd270487cc0965b9..ec251fc24b2c976f5bdf48cc7beec8a13078d5de 100644 (file)
@@ -33,7 +33,6 @@
 
 
 class Beacon::C_MDS_BeaconSender : public Context {
-  Beacon *beacon;
 public:
   explicit C_MDS_BeaconSender(Beacon *beacon_) : beacon(beacon_) {}
   void finish(int r) {
@@ -41,6 +40,8 @@ public:
     beacon->sender = NULL;
     beacon->_send();
   }
+private:
+  Beacon *beacon;
 };
 
 Beacon::Beacon(CephContext *cct_, MonClient *monc_, std::string name_) :
index 9ac3888e778565a24212b24264d8778a23802f7f..17ad0c6711828cf66594598e5fda2a0877978649 100644 (file)
@@ -39,6 +39,42 @@ class MDSRank;
  */
 class Beacon : public Dispatcher
 {
+public:
+  Beacon(CephContext *cct_, MonClient *monc_, std::string name);
+  ~Beacon();
+
+  void init(MDSMap const *mdsmap);
+  void shutdown();
+
+  bool ms_dispatch(Message *m);
+  void ms_handle_connect(Connection *c) {}
+  bool ms_handle_reset(Connection *c) {return false;}
+  void ms_handle_remote_reset(Connection *c) {}
+  bool ms_handle_refused(Connection *c) {return false;}
+
+  void notify_mdsmap(MDSMap const *mdsmap);
+  void notify_health(MDSRank const *mds);
+
+  void handle_mds_beacon(MMDSBeacon *m);
+  void send();
+
+  void set_want_state(MDSMap const *mdsmap, MDSMap::DaemonState const newstate);
+  MDSMap::DaemonState get_want_state() const;
+
+  /**
+   * Send a beacon, and block until the ack is received from the mon
+   * or `duration` seconds pass, whichever happens sooner.  Useful
+   * for emitting a last message on shutdown.
+   */
+  void send_and_wait(const double duration);
+
+  bool is_laggy();
+  utime_t get_laggy_until() const;
+
+private:
+  void _notify_mdsmap(MDSMap const *mdsmap);
+  void _send();
+
   //CephContext *cct;
   mutable Mutex lock;
   MonClient*    monc;
@@ -69,43 +105,8 @@ class Beacon : public Dispatcher
   class C_MDS_BeaconSender;
   C_MDS_BeaconSender *sender;
 
-  void _notify_mdsmap(MDSMap const *mdsmap);
-  void _send();
-
   version_t awaiting_seq;
   Cond waiting_cond;
-
-public:
-  Beacon(CephContext *cct_, MonClient *monc_, std::string name);
-  ~Beacon();
-
-  void init(MDSMap const *mdsmap);
-  void shutdown();
-
-  bool ms_dispatch(Message *m); 
-  void ms_handle_connect(Connection *c) {}
-  bool ms_handle_reset(Connection *c) {return false;}
-  void ms_handle_remote_reset(Connection *c) {}
-  bool ms_handle_refused(Connection *c) {return false;}
-
-  void notify_mdsmap(MDSMap const *mdsmap);
-  void notify_health(MDSRank const *mds);
-
-  void handle_mds_beacon(MMDSBeacon *m);
-  void send();
-
-  void set_want_state(MDSMap const *mdsmap, MDSMap::DaemonState const newstate);
-  MDSMap::DaemonState get_want_state() const;
-
-  /**
-   * Send a beacon, and block until the ack is received from the mon
-   * or `duration` seconds pass, whichever happens sooner.  Useful
-   * for emitting a last message on shutdown.
-   */
-  void send_and_wait(const double duration);
-
-  bool is_laggy();
-  utime_t get_laggy_until() const;
 };
 
 #endif // BEACON_STATE_H