From: Yehuda Sadeh Date: Thu, 27 Aug 2015 19:03:40 +0000 (-0700) Subject: rgw: init object expirer thread X-Git-Tag: v9.1.0~229^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eee424c22ff0210b7fa086d3c17b4fea3cb3e5bd;p=ceph.git rgw: init object expirer thread Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index a172d8bfd017..00996cad3bbf 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -48,6 +48,7 @@ using namespace librados; #include "rgw_log.h" #include "rgw_gc.h" +#include "rgw_object_expirer_core.h" #define dout_subsys ceph_subsys_rgw @@ -1447,9 +1448,14 @@ void RGWRados::finalize() delete data_log; if (use_gc_thread) { gc->stop_processor(); - delete gc; - gc = NULL; + obj_expirer->stop_processor(); } + delete gc; + gc = NULL; + + delete obj_expirer; + obj_expirer = NULL; + delete rest_master_conn; map::iterator iter; @@ -1624,8 +1630,12 @@ int RGWRados::init_complete() gc = new RGWGC(); gc->initialize(cct, this); - if (use_gc_thread) + obj_expirer = new RGWObjectExpirer(this); + + if (use_gc_thread) { gc->start_processor(); + obj_expirer->start_processor(); + } quota_handler = RGWQuotaHandler::generate_handler(this, quota_threads); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 68faada74bd2..5ee67c5983a3 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -22,6 +22,7 @@ class RGWWatcher; class SafeTimer; class ACLOwner; class RGWGC; +class RGWObjectExpirer; /* flags for put_obj_meta() */ #define PUT_OBJ_CREATE 0x01 @@ -1241,6 +1242,7 @@ class RGWRados }; RGWGC *gc; + RGWObjectExpirer *obj_expirer; bool use_gc_thread; bool quota_threads; @@ -1297,7 +1299,7 @@ protected: public: RGWRados() : max_req_id(0), lock("rados_timer_lock"), watchers_lock("watchers_lock"), timer(NULL), - gc(NULL), use_gc_thread(false), quota_threads(false), + gc(NULL), obj_expirer(NULL), use_gc_thread(false), quota_threads(false), num_watchers(0), watchers(NULL), watch_initialized(false), bucket_id_lock("rados_bucket_id"),