X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FServiceDaemon.h;fp=src%2Fceph%2Fsrc%2Ftools%2Frbd_mirror%2FServiceDaemon.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=1f84269dc220fa3ae95f14eb7c99c4377b75e618;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/tools/rbd_mirror/ServiceDaemon.h b/src/ceph/src/tools/rbd_mirror/ServiceDaemon.h deleted file mode 100644 index 1f84269..0000000 --- a/src/ceph/src/tools/rbd_mirror/ServiceDaemon.h +++ /dev/null @@ -1,86 +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_SERVICE_DAEMON_H -#define CEPH_RBD_MIRROR_SERVICE_DAEMON_H - -#include "common/Mutex.h" -#include "tools/rbd_mirror/types.h" -#include "tools/rbd_mirror/service_daemon/Types.h" -#include -#include - -struct CephContext; -struct Context; -namespace librbd { struct ImageCtx; } - -namespace rbd { -namespace mirror { - -template struct Threads; - -template -class ServiceDaemon { -public: - ServiceDaemon(CephContext *cct, RadosRef rados, Threads* threads); - ~ServiceDaemon(); - - int init(); - - void add_pool(int64_t pool_id, const std::string& pool_name); - void remove_pool(int64_t pool_id); - - uint64_t add_or_update_callout(int64_t pool_id, uint64_t callout_id, - service_daemon::CalloutLevel callout_level, - const std::string& text); - void remove_callout(int64_t pool_id, uint64_t callout_id); - - void add_or_update_attribute(int64_t pool_id, const std::string& key, - const service_daemon::AttributeValue& value); - void remove_attribute(int64_t pool_id, const std::string& key); - -private: - struct Callout { - service_daemon::CalloutLevel level; - std::string text; - - Callout() : level(service_daemon::CALLOUT_LEVEL_INFO) { - } - Callout(service_daemon::CalloutLevel level, const std::string& text) - : level(level), text(text) { - } - }; - typedef std::map Callouts; - typedef std::map Attributes; - - struct Pool { - std::string name; - Callouts callouts; - Attributes attributes; - - Pool(const std::string& name) : name(name) { - } - }; - - typedef std::map Pools; - - CephContext *m_cct; - RadosRef m_rados; - Threads* m_threads; - - Mutex m_lock; - Pools m_pools; - uint64_t m_callout_id = service_daemon::CALLOUT_ID_NONE; - - Context* m_timer_ctx = nullptr; - - void schedule_update_status(); - void update_status(); -}; - -} // namespace mirror -} // namespace rbd - -extern template class rbd::mirror::ServiceDaemon; - -#endif // CEPH_RBD_MIRROR_SERVICE_DAEMON_H