]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd-mirror: drop 'using namespace' in image replayer state machine
authorJason Dillaman <dillaman@redhat.com>
Sat, 7 Dec 2019 02:50:15 +0000 (21:50 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 16 Dec 2019 01:03:36 +0000 (20:03 -0500)
This is going to cause conflicts w/ the '::journal' namespace and
future 'rbd::mirror::image_replayer::journal' namespace.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/rbd_mirror/test_mock_ImageReplayer.cc
src/tools/rbd_mirror/ImageReplayer.cc

index 8971af04bc66e2f4dd006329b36f0851c0b26b42..310e17b0c2b98311d284381bf3f21db03effab43 100644 (file)
@@ -120,17 +120,6 @@ class InstanceWatcher<librbd::MockTestImageCtx> {
 
 namespace image_replayer {
 
-using ::testing::_;
-using ::testing::AtLeast;
-using ::testing::DoAll;
-using ::testing::InSequence;
-using ::testing::Invoke;
-using ::testing::MatcherCast;
-using ::testing::Return;
-using ::testing::ReturnArg;
-using ::testing::SetArgPointee;
-using ::testing::WithArg;
-
 template<>
 struct PrepareLocalImageRequest<librbd::MockTestImageCtx> {
   static PrepareLocalImageRequest* s_instance;
@@ -353,17 +342,28 @@ ReplayStatusFormatter<librbd::MockTestImageCtx>* ReplayStatusFormatter<librbd::M
 namespace rbd {
 namespace mirror {
 
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::DoAll;
+using ::testing::InSequence;
+using ::testing::Invoke;
+using ::testing::MatcherCast;
+using ::testing::Return;
+using ::testing::ReturnArg;
+using ::testing::SetArgPointee;
+using ::testing::WithArg;
+
 class TestMockImageReplayer : public TestMockFixture {
 public:
   typedef Threads<librbd::MockTestImageCtx> MockThreads;
   typedef ImageDeleter<librbd::MockTestImageCtx> MockImageDeleter;
   typedef MirrorStatusUpdater<librbd::MockTestImageCtx> MockMirrorStatusUpdater;
-  typedef BootstrapRequest<librbd::MockTestImageCtx> MockBootstrapRequest;
-  typedef CloseImageRequest<librbd::MockTestImageCtx> MockCloseImageRequest;
-  typedef EventPreprocessor<librbd::MockTestImageCtx> MockEventPreprocessor;
-  typedef PrepareLocalImageRequest<librbd::MockTestImageCtx> MockPrepareLocalImageRequest;
-  typedef PrepareRemoteImageRequest<librbd::MockTestImageCtx> MockPrepareRemoteImageRequest;
-  typedef ReplayStatusFormatter<librbd::MockTestImageCtx> MockReplayStatusFormatter;
+  typedef image_replayer::BootstrapRequest<librbd::MockTestImageCtx> MockBootstrapRequest;
+  typedef image_replayer::CloseImageRequest<librbd::MockTestImageCtx> MockCloseImageRequest;
+  typedef image_replayer::EventPreprocessor<librbd::MockTestImageCtx> MockEventPreprocessor;
+  typedef image_replayer::PrepareLocalImageRequest<librbd::MockTestImageCtx> MockPrepareLocalImageRequest;
+  typedef image_replayer::PrepareRemoteImageRequest<librbd::MockTestImageCtx> MockPrepareRemoteImageRequest;
+  typedef image_replayer::ReplayStatusFormatter<librbd::MockTestImageCtx> MockReplayStatusFormatter;
   typedef librbd::journal::Replay<librbd::MockTestImageCtx> MockReplay;
   typedef ImageReplayer<librbd::MockTestImageCtx> MockImageReplayer;
   typedef InstanceWatcher<librbd::MockTestImageCtx> MockInstanceWatcher;
index 4b6b73180c08ebf82c744b9df0c6607059a083eb..e08e4dde00acd8ee21322f27c5496bcb5aa3b18a 100644 (file)
@@ -52,7 +52,6 @@ namespace mirror {
 using librbd::util::create_async_context_callback;
 using librbd::util::create_context_callback;
 using librbd::util::create_rados_callback;
-using namespace rbd::mirror::image_replayer;
 
 template <typename I>
 std::ostream &operator<<(std::ostream &os,
@@ -381,7 +380,7 @@ void ImageReplayer<I>::prepare_local_image() {
   m_local_image_id = "";
   Context *ctx = create_context_callback<
     ImageReplayer, &ImageReplayer<I>::handle_prepare_local_image>(this);
-  auto req = PrepareLocalImageRequest<I>::create(
+  auto req = image_replayer::PrepareLocalImageRequest<I>::create(
     m_local_io_ctx, m_global_image_id, &m_local_image_id, &m_local_image_name,
     &m_local_image_tag_owner, m_threads->work_queue, ctx);
   req->send();
@@ -424,7 +423,7 @@ void ImageReplayer<I>::prepare_remote_image() {
 
   Context *ctx = create_context_callback<
     ImageReplayer, &ImageReplayer<I>::handle_prepare_remote_image>(this);
-  auto req = PrepareRemoteImageRequest<I>::create(
+  auto req = image_replayer::PrepareRemoteImageRequest<I>::create(
     m_threads, m_remote_image.io_ctx, m_global_image_id, m_local_mirror_uuid,
     m_local_image_id, journal_settings, m_cache_manager_handler,
     &m_remote_image.mirror_uuid, &m_remote_image.image_id, &m_remote_journaler,
@@ -478,7 +477,7 @@ void ImageReplayer<I>::bootstrap() {
     return;
   }
 
-  BootstrapRequest<I> *request = nullptr;
+  image_replayer::BootstrapRequest<I> *request = nullptr;
   {
     std::lock_guard locker{m_lock};
     if (on_start_interrupted(m_lock)) {
@@ -487,7 +486,7 @@ void ImageReplayer<I>::bootstrap() {
 
     auto ctx = create_context_callback<
       ImageReplayer, &ImageReplayer<I>::handle_bootstrap>(this);
-    request = BootstrapRequest<I>::create(
+    request = image_replayer::BootstrapRequest<I>::create(
       m_threads, m_local_io_ctx, m_remote_image.io_ctx, m_instance_watcher,
       &m_local_image_ctx, m_local_image_id, m_remote_image.image_id,
       m_global_image_id, m_local_mirror_uuid, m_remote_image.mirror_uuid,
@@ -622,8 +621,8 @@ void ImageReplayer<I>::handle_start_replay(int r) {
     return;
   }
 
-  m_replay_status_formatter =
-    ReplayStatusFormatter<I>::create(m_remote_journaler, m_local_mirror_uuid);
+  m_replay_status_formatter = image_replayer::ReplayStatusFormatter<I>::create(
+    m_remote_journaler, m_local_mirror_uuid);
 
   Context *on_finish(nullptr);
   {
@@ -633,7 +632,7 @@ void ImageReplayer<I>::handle_start_replay(int r) {
     std::swap(m_on_start_finish, on_finish);
   }
 
-  m_event_preprocessor = EventPreprocessor<I>::create(
+  m_event_preprocessor = image_replayer::EventPreprocessor<I>::create(
     *m_local_image_ctx, *m_remote_journaler, m_local_mirror_uuid,
     &m_client_meta, m_threads->work_queue);
 
@@ -1526,7 +1525,7 @@ void ImageReplayer<I>::shut_down(int r) {
   // close the local image (release exclusive lock)
   if (m_local_image_ctx) {
     ctx = new LambdaContext([this, ctx](int r) {
-      CloseImageRequest<I> *request = CloseImageRequest<I>::create(
+      auto request = image_replayer::CloseImageRequest<I>::create(
         &m_local_image_ctx, ctx);
       request->send();
     });
@@ -1543,7 +1542,7 @@ void ImageReplayer<I>::shut_down(int r) {
           m_local_journal->stop_external_replay();
           m_local_replay = nullptr;
 
-          EventPreprocessor<I>::destroy(m_event_preprocessor);
+          image_replayer::EventPreprocessor<I>::destroy(m_event_preprocessor);
           m_event_preprocessor = nullptr;
           ctx->complete(0);
         });
@@ -1644,7 +1643,7 @@ void ImageReplayer<I>::handle_shut_down(int r) {
   }
 
   dout(10) << "stop complete" << dendl;
-  ReplayStatusFormatter<I>::destroy(m_replay_status_formatter);
+  image_replayer::ReplayStatusFormatter<I>::destroy(m_replay_status_formatter);
   m_replay_status_formatter = nullptr;
 
   Context *on_start = nullptr;