]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mds/MDBalancer.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / mds / MDBalancer.h
index 4050eac965014f1e04cf3be6b1176531555bc29c..c6d85a5aed6e289003fcc74ee34da0509e9545ae 100644 (file)
  * Foundation.  See file COPYING.
  * 
  */
-
-
-
 #ifndef CEPH_MDBALANCER_H
 #define CEPH_MDBALANCER_H
 
-#include <list>
-#include <map>
-
 #include "include/types.h"
 #include "common/Clock.h"
 #include "common/Cond.h"
@@ -46,7 +40,7 @@ public:
 
   void handle_conf_change(const std::set<std::string>& changed, const MDSMap& mds_map);
 
-  int proc_message(const Message::const_ref &m);
+  int proc_message(const cref_t<Message> &m);
 
   /**
    * Regularly called upkeep function.
@@ -75,13 +69,9 @@ public:
 
   void handle_mds_failure(mds_rank_t who);
 
-  int dump_loads(Formatter *f);
+  int dump_loads(Formatter *f) const;
 
 private:
-  bool bal_fragment_dirs;
-  int64_t bal_fragment_interval;
-  static const unsigned int AUTH_TREES_THRESHOLD = 5;
-
   typedef struct {
     std::map<mds_rank_t, double> targets;
     std::map<mds_rank_t, double> imported;
@@ -98,10 +88,10 @@ private:
   mds_load_t get_load();
   int localize_balancer();
   void send_heartbeat();
-  void handle_heartbeat(const MHeartbeat::const_ref &m);
+  void handle_heartbeat(const cref_t<MHeartbeat> &m);
   void find_exports(CDir *dir,
                     double amount,
-                    std::list<CDir*>& exports,
+                    std::vector<CDir*>* exports,
                     double& have,
                     set<CDir*>& already_exporting);
 
@@ -125,6 +115,10 @@ private:
    */
   void try_rebalance(balance_state_t& state);
 
+  bool bal_fragment_dirs;
+  int64_t bal_fragment_interval;
+  static const unsigned int AUTH_TREES_THRESHOLD = 5;
+
   MDSRank *mds;
   Messenger *messenger;
   MonClient *mon_client;
@@ -145,11 +139,11 @@ private:
   // just as soon as a delayed context comes back and triggers it.
   // These sets just prevent us from spawning extra timer contexts for
   // dirfrags that already have one in flight.
-  set<dirfrag_t>   split_pending, merge_pending;
+  set<dirfrag_t> split_pending, merge_pending;
 
   // per-epoch scatter/gathered info
-  std::map<mds_rank_t, mds_load_t>  mds_load;
-  std::map<mds_rank_t, double>       mds_meta_load;
+  std::map<mds_rank_t, mds_load_t> mds_load;
+  std::map<mds_rank_t, double> mds_meta_load;
   std::map<mds_rank_t, map<mds_rank_t, float> > mds_import_map;
   std::map<mds_rank_t, int> mds_last_epoch_under_map;
 
@@ -157,5 +151,4 @@ private:
   double my_load = 0;
   double target_load = 0;
 };
-
 #endif