X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2Fimage_replayer%2FReplayStatusFormatter.h;fp=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2Fimage_replayer%2FReplayStatusFormatter.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=59940a651fbca1ce76d0934daf6a48461f07db33;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/tools/rbd_mirror/image_replayer/ReplayStatusFormatter.h b/src/ceph/src/tools/rbd_mirror/image_replayer/ReplayStatusFormatter.h deleted file mode 100644 index 59940a6..0000000 --- a/src/ceph/src/tools/rbd_mirror/image_replayer/ReplayStatusFormatter.h +++ /dev/null @@ -1,60 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#ifndef RBD_MIRROR_IMAGE_REPLAYER_REPLAY_STATUS_FORMATTER_H -#define RBD_MIRROR_IMAGE_REPLAYER_REPLAY_STATUS_FORMATTER_H - -#include "include/Context.h" -#include "common/Mutex.h" -#include "cls/journal/cls_journal_types.h" -#include "librbd/journal/Types.h" -#include "librbd/journal/TypeTraits.h" - -namespace journal { class Journaler; } -namespace librbd { class ImageCtx; } - -namespace rbd { -namespace mirror { -namespace image_replayer { - -template -class ReplayStatusFormatter { -public: - typedef typename librbd::journal::TypeTraits::Journaler Journaler; - - static ReplayStatusFormatter* create(Journaler *journaler, - const std::string &mirror_uuid) { - return new ReplayStatusFormatter(journaler, mirror_uuid); - } - - static void destroy(ReplayStatusFormatter* formatter) { - delete formatter; - } - - ReplayStatusFormatter(Journaler *journaler, const std::string &mirror_uuid); - - bool get_or_send_update(std::string *description, Context *on_finish); - -private: - Journaler *m_journaler; - std::string m_mirror_uuid; - Mutex m_lock; - Context *m_on_finish = nullptr; - cls::journal::ObjectPosition m_master_position; - cls::journal::ObjectPosition m_mirror_position; - int m_entries_behind_master = 0; - cls::journal::Tag m_tag; - std::map m_tag_cache; - - bool calculate_behind_master_or_send_update(); - void send_update_tag_cache(uint64_t master_tag_tid, uint64_t mirror_tag_tid); - void handle_update_tag_cache(uint64_t master_tag_tid, uint64_t mirror_tag_tid, - int r); - void format(std::string *description); -}; - -} // namespace image_replayer -} // namespace mirror -} // namespace rbd - -#endif // RBD_MIRROR_IMAGE_REPLAYER_REPLAY_STATUS_FORMATTER_H