]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: register RGWPeriodPusher with RGWRealmWatcher
authorCasey Bodley <cbodley@redhat.com>
Tue, 10 Nov 2015 21:06:41 +0000 (16:06 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:35 +0000 (16:13 -0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_main.cc

index 8718ed48da0a3da8c4b04bcb643381b82e3d2608..9f233292bb0f429a7423fc4df466aaf56a05ba50 100644 (file)
@@ -39,6 +39,7 @@
 #include "rgw_acl.h"
 #include "rgw_user.h"
 #include "rgw_op.h"
+#include "rgw_period_pusher.h"
 #include "rgw_realm_reloader.h"
 #include "rgw_rest.h"
 #include "rgw_rest_s3.h"
@@ -1103,17 +1104,23 @@ public:
 // FrontendPauser implementation for RGWRealmReloader
 class RGWFrontendPauser : public RGWRealmReloader::Pauser {
   std::list<RGWFrontend*> &frontends;
+  RGWRealmReloader::Pauser* pauser;
  public:
-  RGWFrontendPauser(std::list<RGWFrontend*> &frontends)
-    : frontends(frontends) {}
+  RGWFrontendPauser(std::list<RGWFrontend*> &frontends,
+                    RGWRealmReloader::Pauser* pauser = nullptr)
+    : frontends(frontends), pauser(pauser) {}
 
   void pause() override {
     for (auto frontend : frontends)
       frontend->pause_for_new_config();
+    if (pauser)
+      pauser->pause();
   }
   void resume(RGWRados *store) {
     for (auto frontend : frontends)
       frontend->unpause_with_new_config(store);
+    if (pauser)
+      pauser->resume(store);
   }
 };
 
@@ -1340,11 +1347,13 @@ int main(int argc, const char **argv)
   }
 
   // add a watcher to respond to realm configuration changes
-  RGWFrontendPauser pauser(fes);
+  RGWPeriodPusher pusher(store);
+  RGWFrontendPauser pauser(fes, &pusher);
   RGWRealmReloader reloader(store, &pauser);
 
   RGWRealmWatcher realm_watcher(g_ceph_context, store->realm);
   realm_watcher.add_watcher(RGWRealmNotify::Reload, reloader);
+  realm_watcher.add_watcher(RGWRealmNotify::ZonesNeedPeriod, pusher);
 
   wait_shutdown();