X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FClusterWatcher.h;fp=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FClusterWatcher.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=1099db4e0bcc1eacb6f4f09a2b87810ac100e5a4;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/tools/rbd_mirror/ClusterWatcher.h b/src/ceph/src/tools/rbd_mirror/ClusterWatcher.h deleted file mode 100644 index 1099db4..0000000 --- a/src/ceph/src/tools/rbd_mirror/ClusterWatcher.h +++ /dev/null @@ -1,62 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#ifndef CEPH_RBD_MIRROR_CLUSTER_WATCHER_H -#define CEPH_RBD_MIRROR_CLUSTER_WATCHER_H - -#include -#include -#include - -#include "common/ceph_context.h" -#include "common/Mutex.h" -#include "common/Timer.h" -#include "include/rados/librados.hpp" -#include "types.h" -#include "tools/rbd_mirror/service_daemon/Types.h" -#include - -namespace librbd { struct ImageCtx; } - -namespace rbd { -namespace mirror { - -template class ServiceDaemon; - -/** - * Tracks mirroring configuration for pools in a single - * cluster. - */ -class ClusterWatcher { -public: - typedef std::set Peers; - typedef std::map PoolPeers; - typedef std::set PoolNames; - - ClusterWatcher(RadosRef cluster, Mutex &lock, - ServiceDaemon* service_daemon); - ~ClusterWatcher() = default; - ClusterWatcher(const ClusterWatcher&) = delete; - ClusterWatcher& operator=(const ClusterWatcher&) = delete; - - // Caller controls frequency of calls - void refresh_pools(); - const PoolPeers& get_pool_peers() const; - -private: - typedef std::unordered_map ServicePools; - - RadosRef m_cluster; - Mutex &m_lock; - ServiceDaemon* m_service_daemon; - - ServicePools m_service_pools; - PoolPeers m_pool_peers; - - void read_pool_peers(PoolPeers *pool_peers, PoolNames *pool_names); -}; - -} // namespace mirror -} // namespace rbd - -#endif // CEPH_RBD_MIRROR_CLUSTER_WATCHER_H