X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FImageSyncThrottler.h;fp=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FImageSyncThrottler.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=e0c3f0bf5a9b9c2288f39f129a729c18688a35fb;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/tools/rbd_mirror/ImageSyncThrottler.h b/src/ceph/src/tools/rbd_mirror/ImageSyncThrottler.h deleted file mode 100644 index e0c3f0b..0000000 --- a/src/ceph/src/tools/rbd_mirror/ImageSyncThrottler.h +++ /dev/null @@ -1,61 +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_SYNC_THROTTLER_H -#define RBD_MIRROR_IMAGE_SYNC_THROTTLER_H - -#include -#include -#include -#include -#include - -#include "common/Mutex.h" -#include "common/config_obs.h" - -class Context; - -namespace ceph { class Formatter; } -namespace librbd { class ImageCtx; } - -namespace rbd { -namespace mirror { - -template -class ImageSyncThrottler : public md_config_obs_t { -public: - static ImageSyncThrottler *create() { - return new ImageSyncThrottler(); - } - void destroy() { - delete this; - } - - ImageSyncThrottler(); - ~ImageSyncThrottler() override; - - void set_max_concurrent_syncs(uint32_t max); - void start_op(const std::string &id, Context *on_start); - bool cancel_op(const std::string &id); - void finish_op(const std::string &id); - void drain(int r); - - void print_status(Formatter *f, std::stringstream *ss); - -private: - Mutex m_lock; - uint32_t m_max_concurrent_syncs; - std::list> m_queue; - std::set m_inflight_ops; - - const char **get_tracked_conf_keys() const override; - void handle_conf_change(const struct md_config_t *conf, - const std::set &changed) override; -}; - -} // namespace mirror -} // namespace rbd - -extern template class rbd::mirror::ImageSyncThrottler; - -#endif // RBD_MIRROR_IMAGE_SYNC_THROTTLER_H