RGWSI_SysObj *_sysobj_svc)
{
this->cct = cct;
- store = store;
+ this->store = store;
init(_zone_svc, _meta_svc, _meta_be_svc, _sysobj_svc);
}
{
info->dump(f);
if (has_attrs) {
- encode_json("attrs", attrs, f);
+ encode_json("attrs", info->get_attrs(), f);
}
}
void RGWRoleCompleteInfo::decode_json(JSONObj *obj)
{
decode_json_obj(*info, obj);
- has_attrs = JSONDecoder::decode_json("attrs", attrs, obj);
+ has_attrs = JSONDecoder::decode_json("attrs", info->get_attrs(), obj);
}
const DoutPrefixProvider *dpp)
{
RGWRoleCompleteInfo rci;
-#if 0
- int ret = svc.role->read_info(op->ctx(),
- entry,
- &rci.info,
- &objv_tracker,
- &mtime,
- &rci.attrs,
- y,
- dpp);
-#endif
rci.info = store->get_role(entry).get();
int ret = rci.info->read_info(dpp, y);
if (ret < 0) {
optional_yield y,
const DoutPrefixProvider *dpp)
{
-#if 0
- int ret = svc.role->read_info(op->ctx(), entry, &info, &objv_tracker,
- &_mtime, nullptr, y, dpp);
- if (ret < 0) {
- return ret == -ENOENT ? 0 : ret;
- }
- return svc.role->delete_role(op->ctx(), info, &objv_tracker, y, dpp);
-#endif
std::unique_ptr<rgw::sal::RGWRole> role = store->get_role(entry);
int ret = role->read_info(dpp, y);
if (ret < 0) {
int put_checked(const DoutPrefixProvider *dpp) override {
auto& rci = mdo->get_rci();
auto mtime = mdo->get_mtime();
-#if 0
- int ret = rhandler->role->create(op->ctx(),
- rci.info,
- &objv_tracker,
- mtime,
- false,
- pattrs,
- y,
- dpp);
-
- return ret < 0 ? ret : STATUS_APPLIED;
-#endif
rci.info->set_mtime(mtime);
int ret = rci.info->create(dpp, true, y);
return ret < 0 ? ret : STATUS_APPLIED;
#include "rgw/rgw_rados.h"
#include "rgw_metadata.h"
-class RGWCtl;
class RGWRados;
-class RGWSI_Role;
-class RGWSI_MetaBackend_Handler;
-class RGWRoleCtl;
namespace rgw { namespace sal {
class RGWRole
static constexpr uint64_t SESSION_DURATION_MAX = 43200; // in seconds
protected:
- RGWRoleCtl *role_ctl;
-
std::string id;
std::string name;
std::string path;
const uint64_t& get_max_session_duration() const { return max_session_duration; }
const RGWObjVersionTracker& get_objv_tracker() const { return objv_tracker; }
const real_time& get_mtime() const { return mtime; }
+ std::map<std::string, bufferlist>& get_attrs() { return attrs; }
void set_id(const std::string& id) { this->id = id; }
- //TODO: Remove the following two
- void set_arn(const std::string& arn) { this->arn = arn; }
- void set_creation_date(const std::string& creation_date) { this->creation_date = creation_date; }
void set_mtime(const real_time& mtime) { this->mtime = mtime; }
virtual int create(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y) = 0;
struct RGWRoleCompleteInfo {
RGWRole* info;
- std::map<std::string, bufferlist> attrs;
bool has_attrs;
void dump(Formatter *f) const;
private:
RGWSI_MetaBackend_Handler *be_handler;
std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
- std::unique_ptr<Store> store;
+ Store* store;
CephContext *cct;
};
} } // namespace rgw::sal
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<rgw::sal::RadosRole>(store);
if (have_cache) {
sysobj_cache = std::make_unique<RGWSI_SysObj_Cache>(dpp, cct);
}
user_rados->init(rados.get(), zone.get(), sysobj.get(), sysobj_cache.get(),
meta.get(), meta_be_sobj.get(), sync_modules.get());
- //role_rados->init(zone.get(), meta.get(), meta_be_sobj.get(), sysobj.get());
can_shutdown = true;
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 */
cache = _svc.sysobj_cache.get();
core = _svc.sysobj_core.get();
user = _svc.user_rados.get();
- //role = _svc.role_rados.get();
return 0;
}
svc.bucket_sync,
svc.bi));
otp.reset(new RGWOTPCtl(svc.zone, svc.otp));
- //role = std::make_unique<RGWRoleCtl>(svc.role, static_cast<RGWRoleMetadataHandler*>(meta.role.get()));
RGWBucketMetadataHandlerBase *bucket_meta_handler = static_cast<RGWBucketMetadataHandlerBase *>(meta.bucket.get());
RGWBucketInstanceMetadataHandlerBase *bi_meta_handler = static_cast<RGWBucketInstanceMetadataHandlerBase *>(meta.bucket_instance.get());
user = _ctl.user.get();
bucket = _ctl.bucket.get();
otp = _ctl.otp.get();
- //role = _ctl.role.get();
r = meta.user->attach(meta.mgr);
if (r < 0) {
#include "common/async/yield_context.h"
#include "rgw/rgw_common.h"
-//#include "rgw/rgw_sal_rados.h"
struct RGWServices_Def;
class RGWSI_Notify;
class RGWSI_OTP;
class RGWSI_RADOS;
-//class RGWSI_Role;
-//class RGWSI_Role_RADOS;
class RGWSI_Zone;
class RGWSI_ZoneUtils;
class RGWSI_Quota;
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<rgw::sal::RadosRole> role_rados;
RGWServices_Def();
~RGWServices_Def();
class RGWUserCtl;
class RGWBucketCtl;
class RGWOTPCtl;
-//class RGWRoleCtl;
struct RGWCtlDef {
struct _meta {
std::unique_ptr<RGWUserCtl> user;
std::unique_ptr<RGWBucketCtl> bucket;
std::unique_ptr<RGWOTPCtl> otp;
- //std::unique_ptr<RGWRoleCtl> role;
RGWCtlDef();
~RGWCtlDef();
RGWUserCtl *user{nullptr};
RGWBucketCtl *bucket{nullptr};
RGWOTPCtl *otp{nullptr};
- //RGWRoleCtl *role{nullptr};
int init(RGWServices *_svc, rgw::sal::Store* store, const DoutPrefixProvider *dpp);
};