RGWFrontend* fe = nullptr;
if (framework == "loadgen") {
- std::string uri_prefix;
- config->get_val("prefix", "", &uri_prefix);
-
- RGWProcessEnv env = {driver, &rest, olog, uri_prefix,
+ RGWProcessEnv env = {driver, &rest, olog,
auth_registry, ratelimiter.get(), lua_background.get()};
fe = new RGWLoadGenFrontend(env, config);
else if (framework == "beast") {
int port;
config->get_val("port", 80, &port);
- std::string uri_prefix;
- config->get_val("prefix", "", &uri_prefix);
- RGWProcessEnv env{driver, &rest, olog, uri_prefix,
+ RGWProcessEnv env{driver, &rest, olog,
auth_registry, ratelimiter.get(), lua_background.get()};
fe = new RGWAsioFrontend(env, config, *(sched_ctx.get()));
}
parse_buffer& buffer, bool is_ssl,
SharedMutex& pause_mutex,
rgw::dmclock::Scheduler *scheduler,
+ const std::string& uri_prefix,
std::unique_ptr<rgw::sal::LuaManager>& lua_manager,
boost::system::error_code& ec,
yield_context yield)
string user = "-";
const auto started = ceph::coarse_real_clock::now();
ceph::coarse_real_clock::duration latency{};
- process_request(env.driver, env.rest, &req, env.uri_prefix,
+ process_request(env.driver, env.rest, &req, uri_prefix,
*env.auth_registry, &client, env.olog, y,
scheduler, &user, &latency,
env.ratelimiting->get_active(),
RGWProcessEnv env;
RGWFrontendConfig* conf;
boost::asio::io_context context;
+ std::string uri_prefix;
ceph::timespan request_timeout = std::chrono::milliseconds(REQUEST_TIMEOUT);
size_t header_limit = 16384;
#ifdef WITH_RADOSGW_BEAST_OPENSSL
boost::system::error_code ec;
auto& config = conf->get_config_map();
+ if (auto i = config.find("prefix"); i != config.end()) {
+ uri_prefix = i->second;
+ }
+
// Setting global timeout
auto timeout = config.find("request_timeout_ms");
if (timeout != config.end()) {
conn->buffer.consume(bytes);
handle_connection(context, env, stream, timeout, header_limit,
conn->buffer, true, pause_mutex, scheduler.get(),
- lua_manager,
- ec, yield);
+ uri_prefix, lua_manager, ec, yield);
if (!ec) {
// ssl shutdown (ignoring errors)
stream.async_shutdown(yield[ec]);
boost::system::error_code ec;
handle_connection(context, env, conn->socket, timeout, header_limit,
conn->buffer, false, pause_mutex, scheduler.get(),
- lua_manager,
- ec, yield);
+ uri_prefix, lua_manager, ec, yield);
conn->socket.shutdown(tcp_socket::shutdown_both, ec);
}, make_stack_allocator());
}
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;
int RGWLibFrontend::init()
{
+ std::string uri_prefix; // empty
pprocess = new RGWLibProcess(g_ceph_context, &env,
- g_conf()->rgw_thread_pool_size, conf);
+ g_conf()->rgw_thread_pool_size, uri_prefix, conf);
return 0;
}
public:
RGWLibProcess(CephContext* cct, RGWProcessEnv* pe, int num_threads,
- RGWFrontendConfig* _conf) :
- RGWProcess(cct, pe, num_threads, _conf), gen(0), shutdown(false) {}
+ std::string uri_prefix, RGWFrontendConfig* _conf) :
+ RGWProcess(cct, pe, num_threads, std::move(uri_prefix), _conf),
+ gen(0), shutdown(false) {}
void run() override;
void checkpoint();
rgw::sal::Driver* driver = nullptr;
RGWREST *rest = nullptr;
OpsLogSink *olog = nullptr;
- std::string uri_prefix;
std::shared_ptr<rgw::auth::StrategyRegistry> auth_registry;
ActiveRateLimiter* ratelimiting = nullptr;
rgw::lua::Background* lua_background = nullptr;
RGWProcess(CephContext* const cct,
RGWProcessEnv* const pe,
const int num_threads,
+ std::string uri_prefix,
RGWFrontendConfig* const conf)
: cct(cct),
driver(pe->driver),
rest(pe->rest),
conf(conf),
sock_fd(-1),
- uri_prefix(pe->uri_prefix),
+ uri_prefix(std::move(uri_prefix)),
lua_background(pe->lua_background),
lua_manager(driver->get_lua_manager()),
req_wq(this,
RGWAccessKey access_key;
public:
RGWLoadGenProcess(CephContext* cct, RGWProcessEnv* pe, int num_threads,
- RGWFrontendConfig* _conf) :
- RGWProcess(cct, pe, num_threads, _conf) {}
+ std::string uri_prefix, RGWFrontendConfig* _conf)
+ : RGWProcess(cct, pe, num_threads, std::move(uri_prefix), _conf) {}
void run() override;
void checkpoint();
void handle_request(const DoutPrefixProvider *dpp, RGWRequest* req) override;