RGWRoleMetadataHandler and class RGWSI_Role_Module.
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
svc.meta = _meta_svc;
svc.meta_be = _meta_be_svc;
svc.sysobj = _sysobj_svc;
+ 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;
+ }
+
+ 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);
+ base_init(cct, get_be_handler());
}
+#if 0
int RGWRoleMetadataHandler::do_start(optional_yield y, const DoutPrefixProvider *dpp)
{
bh->set_module(module);
return 0;
}
+#endif
-RGWRoleMetadataHandler::RGWRoleMetadataHandler(CephContext *cct, Store* store)
+RGWRoleMetadataHandler::RGWRoleMetadataHandler(CephContext *cct, Store* store,
+ RGWSI_Zone *_zone_svc,
+ RGWSI_Meta *_meta_svc,
+ RGWSI_MetaBackend *_meta_be_svc,
+ RGWSI_SysObj *_sysobj_svc)
{
- base_init(cct, get_be_handler());
+ this->cct = cct;
store = store;
+ init(_zone_svc, _meta_svc, _meta_be_svc, _sysobj_svc);
}
void RGWRoleCompleteInfo::dump(ceph::Formatter *f) const
RGWSI_MetaBackend_Handler * get_be_handler();
- int do_start(optional_yield y, const DoutPrefixProvider *dpp);
+ //int do_start(optional_yield y, const DoutPrefixProvider *dpp);
- RGWRoleMetadataHandler(CephContext *cct, Store* store);
+ RGWRoleMetadataHandler(CephContext *cct, Store* store,
+ RGWSI_Zone *_zone_svc,
+ RGWSI_Meta *_meta_svc,
+ RGWSI_MetaBackend *_meta_be_svc,
+ RGWSI_SysObj *_sysobj_svc);
std::string get_type() final { return "roles"; }
RGWSI_MetaBackend_Handler *be_handler;
std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
std::unique_ptr<Store> store;
+ CephContext *cct;
};
} } // namespace rgw::sal
}
meta.otp.reset(RGWOTPMetaHandlerAllocator::alloc());
- meta.role = std::make_unique<rgw::sal::RGWRoleMetadataHandler>(svc.cct, store);
+ meta.role = std::make_unique<rgw::sal::RGWRoleMetadataHandler>(svc.cct, store, svc.zone, svc.meta, svc.meta_be_sobj, svc.sysobj);
user.reset(new RGWUserCtl(svc.zone, svc.user, (RGWUserMetadataHandler *)meta.user.get()));
bucket.reset(new RGWBucketCtl(svc.zone,