summaryrefslogtreecommitdiffstats
path: root/src/rgw/services/svc_notify.h
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2018-09-05 12:11:16 +0200
committerYehuda Sadeh <yehuda@redhat.com>2018-11-08 18:19:29 +0100
commit074936b5c2d8d62c3ca2afe6349b39815ec2cd62 (patch)
treeb526cd9bf59c74caef960d3506b62c1a2bbd8f5a /src/rgw/services/svc_notify.h
parentrgw: sysobj service: initial cache conversion (diff)
downloadceph-074936b5c2d8d62c3ca2afe6349b39815ec2cd62.tar.xz
ceph-074936b5c2d8d62c3ca2afe6349b39815ec2cd62.zip
rgw: svc_notify: initial work
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/rgw/services/svc_notify.h')
-rw-r--r--src/rgw/services/svc_notify.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/rgw/services/svc_notify.h b/src/rgw/services/svc_notify.h
new file mode 100644
index 00000000000..d1118cbabb5
--- /dev/null
+++ b/src/rgw/services/svc_notify.h
@@ -0,0 +1,63 @@
+#ifndef CEPH_RGW_SERVICES_NOTIFY_H
+#define CEPH_RGW_SERVICES_NOTIFY_H
+
+
+#include "rgw/rgw_service.h"
+
+#include "svc_rados.h"
+
+
+class RGWSI_Zone;
+
+class RGWWatcher;
+
+class RGWS_Notify : public RGWService
+{
+public:
+ RGWS_Notify(CephContext *cct) : RGWService(cct, "quota") {}
+
+ int create_instance(const std::string& conf, RGWServiceInstanceRef *instance) override;
+};
+
+class RGWSI_Notify : public RGWServiceInstance
+{
+ std::shared_ptr<RGWSI_Zone> zone_svc;
+ std::shared_ptr<RGWSI_RADOS> rados_svc;
+
+ std::map<std::string, RGWServiceInstance::dependency> get_deps() override;
+ int load(const std::string& conf, std::map<std::string, RGWServiceInstanceRef>& dep_refs) override;
+
+ Mutex watchers_lock{"watchers_lock"};
+ rgw_pool control_pool;
+
+ int num_watchers{0};
+ RGWWatcher **watchers{nullptr};
+ std::set<int> watchers_set;
+ vector<RGWSI_RADOS::Obj> notify_objs;
+
+ double inject_notify_timeout_probability{0};
+ unsigned max_notify_retries{0};
+
+ friend class RGWWatcher;
+
+ string get_control_oid(int i);
+ RGWSI_RADOS::Obj pick_control_obj(const string& key);
+
+ int init_watch();
+ void finalize_watch();
+
+ int init() override;
+ void shutdown() override;
+
+ int watch(RGWSI_RADOS::Obj& obj, uint64_t *watch_handle, librados::WatchCtx2 *ctx);
+ int aio_watch(const string& oid, uint64_t *watch_handle, librados::WatchCtx2 *ctx, librados::AioCompletion *c);
+ int unwatch(RGWSI_RADOS::Obj& obj, uint64_t watch_handle);
+ void add_watcher(int i);
+ void remove_watcher(int i);
+public:
+ RGWSI_Notify(RGWService *svc, CephContext *cct): RGWServiceInstance(svc, cct) {}
+
+};
+
+#endif
+