]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/rbd_mirror/ClusterWatcher.h
update sources to v12.1.2
[ceph.git] / ceph / src / tools / rbd_mirror / ClusterWatcher.h
index f101de07ba47b0dc26d6997454f256fb618b47c2..1099db4e0bcc1eacb6f4f09a2b87810ac100e5a4 100644 (file)
 #include "common/Timer.h"
 #include "include/rados/librados.hpp"
 #include "types.h"
+#include "tools/rbd_mirror/service_daemon/Types.h"
+#include <unordered_map>
+
+namespace librbd { struct ImageCtx; }
 
 namespace rbd {
 namespace mirror {
 
+template <typename> class ServiceDaemon;
+
 /**
  * Tracks mirroring configuration for pools in a single
  * cluster.
@@ -27,7 +33,8 @@ public:
   typedef std::map<int64_t, Peers>  PoolPeers;
   typedef std::set<std::string> PoolNames;
 
-  ClusterWatcher(RadosRef cluster, Mutex &lock);
+  ClusterWatcher(RadosRef cluster, Mutex &lock,
+                 ServiceDaemon<librbd::ImageCtx>* service_daemon);
   ~ClusterWatcher() = default;
   ClusterWatcher(const ClusterWatcher&) = delete;
   ClusterWatcher& operator=(const ClusterWatcher&) = delete;
@@ -37,8 +44,13 @@ public:
   const PoolPeers& get_pool_peers() const;
 
 private:
-  Mutex &m_lock;
+  typedef std::unordered_map<int64_t, service_daemon::CalloutId> ServicePools;
+
   RadosRef m_cluster;
+  Mutex &m_lock;
+  ServiceDaemon<librbd::ImageCtx>* m_service_daemon;
+
+  ServicePools m_service_pools;
   PoolPeers m_pool_peers;
 
   void read_pool_peers(PoolPeers *pool_peers, PoolNames *pool_names);