]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_frontend.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rgw / rgw_frontend.h
index a648489ac910dccd76c35ee499c38122ce36ee0c..ca1a8cba14e97a632654812d55ab2b9c5c508f68 100644 (file)
@@ -1,16 +1,17 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab ft=cpp
 
-#ifndef RGW_FRONTEND_H
-#define RGW_FRONTEND_H
+#pragma once
 
 #include <map>
 #include <string>
+#include <vector>
 
 #include "common/RWLock.h"
 
 #include "rgw_request.h"
 #include "rgw_process.h"
+#include "rgw_process_env.h"
 #include "rgw_realm_reloader.h"
 
 #include "rgw_auth_registry.h"
@@ -82,8 +83,7 @@ public:
   virtual void join() = 0;
 
   virtual void pause_for_new_config() = 0;
-  virtual void unpause_with_new_config(rgw::sal::Store* store,
-                                       rgw_auth_registry_ptr_t auth_registry) = 0;
+  virtual void unpause_with_new_config() = 0;
 };
 
 
@@ -91,7 +91,7 @@ class RGWProcessFrontend : public RGWFrontend {
 protected:
   RGWFrontendConfig* conf;
   RGWProcess* pprocess;
-  RGWProcessEnv env;
+  RGWProcessEnv& env;
   RGWProcessControlThread* thread;
 
 public:
@@ -121,11 +121,8 @@ public:
     pprocess->pause();
   }
 
-  void unpause_with_new_config(rgw::sal::Store* const store,
-                               rgw_auth_registry_ptr_t auth_registry) override {
-    env.store = store;
-    env.auth_registry = auth_registry;
-    pprocess->unpause_with_new_config(store, std::move(auth_registry));
+  void unpause_with_new_config() override {
+    pprocess->unpause_with_new_config();
   }
 }; /* RGWProcessFrontend */
 
@@ -134,8 +131,8 @@ public:
   RGWLoadGenFrontend(RGWProcessEnv& pe, RGWFrontendConfig *_conf)
     : RGWProcessFrontend(pe, _conf) {}
 
-  CephContext *get_cct() const { 
-    return env.store->ctx(); 
+  CephContext *get_cct() const {
+    return env.driver->ctx();
   }
 
   unsigned get_subsys() const
@@ -151,8 +148,11 @@ public:
   int init() override {
     int num_threads;
     conf->get_val("num_threads", g_conf()->rgw_thread_pool_size, &num_threads);
-    RGWLoadGenProcess *pp = new RGWLoadGenProcess(g_ceph_context, &env,
-                                                 num_threads, conf);
+    std::string uri_prefix;
+    conf->get_val("prefix", "", &uri_prefix);
+
+    RGWLoadGenProcess *pp = new RGWLoadGenProcess(
+        g_ceph_context, env, num_threads, std::move(uri_prefix), conf);
 
     pprocess = pp;
 
@@ -165,7 +165,7 @@ public:
     }
 
     rgw_user uid(uid_str);
-    std::unique_ptr<rgw::sal::User> user = env.store->get_user(uid);
+    std::unique_ptr<rgw::sal::User> user = env.driver->get_user(uid);
 
     int ret = user->load_user(this, null_yield);
     if (ret < 0) {
@@ -188,18 +188,13 @@ public:
 
 // FrontendPauser implementation for RGWRealmReloader
 class RGWFrontendPauser : public RGWRealmReloader::Pauser {
-  std::list<RGWFrontend*> &frontends;
+  std::vector<RGWFrontend*> &frontends;
   RGWRealmReloader::Pauser* pauser;
-  rgw::auth::ImplicitTenants& implicit_tenants;
 
  public:
-  RGWFrontendPauser(std::list<RGWFrontend*> &frontends,
-                    rgw::auth::ImplicitTenants& implicit_tenants,
+  RGWFrontendPauser(std::vector<RGWFrontend*> &frontends,
                     RGWRealmReloader::Pauser* pauser = nullptr)
-    : frontends(frontends),
-      pauser(pauser),
-      implicit_tenants(implicit_tenants) {
-  }
+    : frontends(frontends), pauser(pauser) {}
 
   void pause() override {
     for (auto frontend : frontends)
@@ -207,17 +202,10 @@ class RGWFrontendPauser : public RGWRealmReloader::Pauser {
     if (pauser)
       pauser->pause();
   }
-  void resume(rgw::sal::Store* store) override {
-    /* Initialize the registry of auth strategies which will coordinate
-     * the dynamic reconfiguration. */
-    auto auth_registry = \
-      rgw::auth::StrategyRegistry::create(g_ceph_context, implicit_tenants, store);
-
+  void resume(rgw::sal::Driver* driver) override {
     for (auto frontend : frontends)
-      frontend->unpause_with_new_config(store, auth_registry);
+      frontend->unpause_with_new_config();
     if (pauser)
-      pauser->resume(store);
+      pauser->resume(driver);
   }
 };
-
-#endif /* RGW_FRONTEND_H */