#include "tools/rbd_mirror/PoolWatcher.h"
#include "tools/rbd_mirror/Threads.h"
#include "tools/rbd_mirror/types.h"
+#include "tools/rbd_mirror/pool_watcher/Types.h"
#include "test/librados/test.h"
#include "gtest/gtest.h"
#include <boost/scope_exit.hpp>
TestFixture::TearDown();
}
- struct PoolWatcherListener : public PoolWatcher<>::Listener {
+ struct PoolWatcherListener : public rbd::mirror::pool_watcher::Listener {
TestPoolWatcher *test;
Cond cond;
ImageIds image_ids;
typedef librbd::MockMirroringWatcher MockMirroringWatcher;
typedef librbd::MirroringWatcher<librbd::MockTestImageCtx> MirroringWatcher;
- struct MockListener : MockPoolWatcher::Listener {
+ struct MockListener : pool_watcher::Listener {
TestMockPoolWatcher *test;
MockListener(TestMockPoolWatcher *test) : test(test) {
#include "PoolWatcher.h"
#include "ImageDeleter.h"
#include "types.h"
+#include "tools/rbd_mirror/pool_watcher/Types.h"
#include "tools/rbd_mirror/service_daemon/Types.h"
#include <set>
* @endverbatim
*/
- struct PoolWatcherListener : public PoolWatcher<>::Listener {
+ struct PoolWatcherListener : public pool_watcher::Listener {
PoolReplayer *pool_replayer;
bool local;
template <typename I>
PoolWatcher<I>::PoolWatcher(Threads<I> *threads, librados::IoCtx &remote_io_ctx,
- Listener &listener)
+ pool_watcher::Listener &listener)
: m_threads(threads), m_remote_io_ctx(remote_io_ctx), m_listener(listener),
m_lock(librbd::util::unique_lock_name("rbd::mirror::PoolWatcher", this)) {
m_mirroring_watcher = new MirroringWatcher(m_remote_io_ctx,
#include <boost/functional/hash.hpp>
#include <boost/optional.hpp>
#include "include/assert.h"
+#include "tools/rbd_mirror/pool_watcher/Types.h"
namespace librbd { struct ImageCtx; }
template <typename ImageCtxT = librbd::ImageCtx>
class PoolWatcher {
public:
- struct Listener {
- virtual ~Listener() {
- }
-
- virtual void handle_update(const std::string &mirror_uuid,
- ImageIds &&added_image_ids,
- ImageIds &&removed_image_ids) = 0;
- };
-
PoolWatcher(Threads<ImageCtxT> *threads, librados::IoCtx &remote_io_ctx,
- Listener &listener);
+ pool_watcher::Listener &listener);
~PoolWatcher();
PoolWatcher(const PoolWatcher&) = delete;
PoolWatcher& operator=(const PoolWatcher&) = delete;
Threads<ImageCtxT> *m_threads;
librados::IoCtx m_remote_io_ctx;
- Listener &m_listener;
+ pool_watcher::Listener &m_listener;
ImageIds m_refresh_image_ids;
bufferlist m_out_bl;
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#ifndef CEPH_RBD_MIRROR_POOL_WATCHER_TYPES_H
+#define CEPH_RBD_MIRROR_POOL_WATCHER_TYPES_H
+
+#include "tools/rbd_mirror/types.h"
+#include <string>
+
+namespace rbd {
+namespace mirror {
+namespace pool_watcher {
+
+struct Listener {
+ virtual ~Listener() {
+ }
+
+ virtual void handle_update(const std::string &mirror_uuid,
+ ImageIds &&added_image_ids,
+ ImageIds &&removed_image_ids) = 0;
+};
+
+} // namespace pool_watcher
+} // namespace mirror
+} // namespace rbd
+
+#endif // CEPH_RBD_MIRROR_POOL_WATCHER_TYPES_H