services/svc_notify.cc
services/svc_quota.cc
services/svc_sync_modules.cc
- services/svc_role_rados.cc
services/svc_sys_obj.cc
services/svc_sys_obj_cache.cc
services/svc_sys_obj_core.cc
#include "services/svc_quota.h"
#include "services/svc_config_key.h"
#include "services/svc_zone_utils.h"
-#include "services/svc_role_rados.h"
#include "services/svc_user.h"
#include "services/svc_sys_obj_cache.h"
#include "cls/rgw/cls_rgw_client.h"
#include "services/svc_sys_obj_cache.h"
#include "services/svc_sys_obj_core.h"
#include "services/svc_user_rados.h"
-#include "services/svc_role_rados.h"
#include "common/errno.h"
sysobj = std::make_unique<RGWSI_SysObj>(cct);
sysobj_core = std::make_unique<RGWSI_SysObj_Core>(cct);
user_rados = std::make_unique<RGWSI_User_RADOS>(cct);
- role_rados = std::make_unique<RGWSI_Role_RADOS>(cct);
async_processor = std::make_unique<RGWAsyncRadosProcessor>(
cct, cct->_conf->rgw_num_async_rados_threads);
}
user_rados->init(driver->getRados()->get_rados_handle(), zone.get(), mdlog.get(),
sysobj.get(), sysobj_cache.get(), meta.get());
- role_rados->init(zone.get(), meta.get(), meta_be_sobj.get(), sysobj.get());
+
can_shutdown = true;
int r = finisher->start(y, dpp);
ldpp_dout(dpp, 0) << "ERROR: failed to start user_rados service (" << cpp_strerror(-r) << dendl;
return r;
}
-
- r = role_rados->start(y, dpp);
- if (r < 0) {
- ldout(cct, 0) << "ERROR: failed to start role_rados service (" << cpp_strerror(-r) << dendl;
- return r;
- }
}
/* cache or core services will be started by sysobj */
return;
}
- role_rados->shutdown();
datalog_rados.reset();
user_rados->shutdown();
sync_modules->shutdown();
cache = _svc.sysobj_cache.get();
core = _svc.sysobj_core.get();
user = _svc.user_rados.get();
- role = _svc.role_rados.get();
async_processor = _svc.async_processor.get();
return 0;
class RGWSI_User;
class RGWSI_User_RADOS;
class RGWDataChangesLog;
-class RGWSI_Role_RADOS;
class RGWAsyncRadosProcessor;
struct RGWServices_Def
std::unique_ptr<RGWSI_SysObj_Cache> sysobj_cache;
std::unique_ptr<RGWSI_User_RADOS> user_rados;
std::unique_ptr<RGWDataChangesLog> datalog_rados;
- std::unique_ptr<RGWSI_Role_RADOS> role_rados;
std::unique_ptr<RGWAsyncRadosProcessor> async_processor;
RGWServices_Def();
RGWSI_SysObj_Cache *cache{nullptr};
RGWSI_SysObj_Core *core{nullptr};
RGWSI_User *user{nullptr};
- RGWSI_Role_RADOS *role{nullptr};
RGWAsyncRadosProcessor* async_processor;
int do_init(CephContext *cct, rgw::sal::RadosStore* store, bool have_cache,
#include "services/svc_sys_obj.h"
#include "services/svc_meta_be_sobj.h"
#include "services/svc_meta.h"
-#include "services/svc_role_rados.h"
#define dout_subsys ceph_subsys_rgw
+++ /dev/null
-#include "svc_role_rados.h"
-#include "svc_meta_be_sobj.h"
-#include "svc_meta.h"
-#include "rgw_role.h"
-#include "rgw_zone.h"
-#include "svc_zone.h"
-#include "rgw_tools.h"
-
-#define dout_subsys ceph_subsys_rgw
-
-class RGWSI_Role_Module : public RGWSI_MBSObj_Handler_Module {
- RGWSI_Role_RADOS::Svc& svc;
- const std::string prefix;
-public:
- RGWSI_Role_Module(RGWSI_Role_RADOS::Svc& _svc): RGWSI_MBSObj_Handler_Module("roles"),
- svc(_svc),
- prefix(role_oid_prefix) {}
-
- void get_pool_and_oid(const std::string& key,
- rgw_pool *pool,
- std::string *oid) override
- {
- if (pool) {
- *pool = svc.zone->get_zone_params().roles_pool;
- }
-
- if (oid) {
- *oid = key_to_oid(key);
- }
- }
-
- bool is_valid_oid(const std::string& oid) override {
- return boost::algorithm::starts_with(oid, prefix);
- }
-
- std::string key_to_oid(const std::string& key) override {
- return prefix + key;
- }
-
- // This is called after `is_valid_oid` and is assumed to be a valid oid
- std::string oid_to_key(const std::string& oid) override {
- return oid.substr(prefix.size());
- }
-
- const std::string& get_oid_prefix() {
- return prefix;
- }
-};
-
-RGWSI_MetaBackend_Handler* RGWSI_Role_RADOS::get_be_handler()
-{
- return be_handler;
-}
-
-void RGWSI_Role_RADOS::init(RGWSI_Zone *_zone_svc,
- RGWSI_Meta *_meta_svc,
- RGWSI_MetaBackend *_meta_be_svc,
- RGWSI_SysObj *_sysobj_svc)
-{
- svc.zone = _zone_svc;
- svc.meta = _meta_svc;
- svc.meta_be = _meta_be_svc;
- svc.sysobj = _sysobj_svc;
-}
-
-int RGWSI_Role_RADOS::do_start(optional_yield y, const DoutPrefixProvider *dpp)
-{
-
- int r = svc.meta->create_be_handler(RGWSI_MetaBackend::Type::MDBE_SOBJ,
- &be_handler);
- if (r < 0) {
- ldout(ctx(), 0) << "ERROR: failed to create be_handler for Roles: r="
- << r <<dendl;
- return r;
- }
-
- auto module = new RGWSI_Role_Module(svc);
- RGWSI_MetaBackend_Handler_SObj* bh= static_cast<RGWSI_MetaBackend_Handler_SObj *>(be_handler);
- be_module.reset(module);
- bh->set_module(module);
- return 0;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab ft=cpp
-
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2020 SUSE LLC
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation. See file COPYING.
- *
- */
-
-#pragma once
-
-#include "rgw_service.h"
-#include "rgw_role.h"
-#include "svc_meta_be.h"
-
-class RGWSI_Role_RADOS: public RGWServiceInstance
-{
- public:
- struct Svc {
- RGWSI_Zone *zone{nullptr};
- RGWSI_Meta *meta{nullptr};
- RGWSI_MetaBackend *meta_be{nullptr};
- RGWSI_SysObj *sysobj{nullptr};
- } svc;
-
- RGWSI_Role_RADOS(CephContext *cct) : RGWServiceInstance(cct) {}
- ~RGWSI_Role_RADOS() {}
-
- void init(RGWSI_Zone *_zone_svc,
- RGWSI_Meta *_meta_svc,
- RGWSI_MetaBackend *_meta_be_svc,
- RGWSI_SysObj *_sysobj_svc);
-
- RGWSI_MetaBackend_Handler * get_be_handler();
- int do_start(optional_yield y, const DoutPrefixProvider *dpp) override;
-
-private:
- RGWSI_MetaBackend_Handler *be_handler;
- std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
-};
-
-static const std::string role_name_oid_prefix = "role_names.";
-static const std::string role_oid_prefix = "roles.";
-static const std::string role_path_oid_prefix = "role_paths.";