const RGWZoneParams& zone_params = store->svc()->zone->get_zone_params();
if (sync_module == nullptr) {
- sync_module = store->getRados()->get_sync_module();
+ sync_module = store->get_sync_module();
}
conn = store->svc()->zone->get_zone_conn(source_zone);
return mgr;
}
-static RGWRESTMgr *rest_filter(RGWRados *store, int dialect, RGWRESTMgr *orig)
+static RGWRESTMgr *rest_filter(rgw::sal::RGWStore* store, int dialect, RGWRESTMgr *orig)
{
RGWSyncModuleInstanceRef sync_module = store->get_sync_module();
if (sync_module) {
const bool swift_at_root = g_conf()->rgw_swift_url_prefix == "/";
if (apis_map.count("s3") > 0 || s3website_enabled) {
if (! swift_at_root) {
- rest.register_default_mgr(set_logging(rest_filter(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados(), RGW_REST_S3,
+ rest.register_default_mgr(set_logging(rest_filter(store, RGW_REST_S3,
new RGWRESTMgr_S3(s3website_enabled, sts_enabled, iam_enabled, pubsub_enabled))));
} else {
derr << "Cannot have the S3 or S3 Website enabled together with "
if (! swift_at_root) {
rest.register_resource(g_conf()->rgw_swift_url_prefix,
- set_logging(rest_filter(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados(), RGW_REST_SWIFT,
+ set_logging(rest_filter(store, RGW_REST_SWIFT,
swift_resource)));
} else {
if (store->get_zonegroup().zones.size() > 1) {
/*Registering resource for /admin/metadata */
admin_resource->register_resource("metadata", new RGWRESTMgr_Metadata);
+ /* XXX dang ifdef these RADOS ? */
admin_resource->register_resource("log", new RGWRESTMgr_Log);
admin_resource->register_resource("config", new RGWRESTMgr_Config);
admin_resource->register_resource("realm", new RGWRESTMgr_Realm);
s->req_id = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone_utils->unique_id(req->id);
s->trans_id = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone_utils->unique_trans_id(req->id);
- s->host_id = static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->host_id;
+ s->host_id = store->get_host_id();
s->yield = yield;
ldpp_dout(s, 2) << "initializing for trans_id = " << s->trans_id << dendl;
}
}
- const auto& local_zone_id = static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->zone_id();
+ const auto& local_zone_id = store->get_zone_id();
if (!merge) {
rgw_sync_bucket_pipe pipe;
std::string data_bucket_prefix = "";
std::string data_oid_prefix = "";
bool push_only = true;
- if (static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_sync_module()) {
- const auto psmodule = dynamic_cast<RGWPSSyncModuleInstance*>(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_sync_module().get());
+ if (store->get_sync_module()) {
+ const auto psmodule = dynamic_cast<RGWPSSyncModuleInstance*>(store->get_sync_module().get());
if (psmodule) {
const auto& conf = psmodule->get_effective_conf();
data_bucket_prefix = conf["data_bucket_prefix"];
}
// require period.realm_id to match our realm
- if (period.get_realm() != static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_realm().get_id()) {
+ if (period.get_realm() != store->get_realm().get_id()) {
error_stream << "period with realm id " << period.get_realm()
- << " doesn't match current realm " << static_cast<rgw::sal::RGWRadosStore*>(store)->svc()->zone->get_realm().get_id() << std::endl;
+ << " doesn't match current realm " << store->get_realm().get_id() << std::endl;
op_ret = -EINVAL;
return;
}
class RGWBucketSyncPolicyHandler;
using RGWBucketSyncPolicyHandlerRef = std::shared_ptr<RGWBucketSyncPolicyHandler>;
class RGWDataSyncStatusManager;
+class RGWSyncModuleInstance;
+typedef std::shared_ptr<RGWSyncModuleInstance> RGWSyncModuleInstanceRef;
namespace rgw {
class Aio;
namespace IAM { struct Policy; }
virtual void meta_list_keys_complete(void* handle) = 0;
virtual std::string meta_get_marker(void *handle) = 0;
virtual int meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y) = 0;
+ virtual const RGWSyncModuleInstanceRef& get_sync_module() = 0;
+ virtual std::string get_host_id() = 0;
virtual void finalize(void) = 0;
virtual void meta_list_keys_complete(void* handle) override;
virtual std::string meta_get_marker(void *handle) override;
virtual int meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y) override;
+ virtual const RGWSyncModuleInstanceRef& get_sync_module() { return rados->get_sync_module(); }
+ virtual std::string get_host_id() { return rados->host_id; }
virtual void finalize(void) override;
protected:
RGWOp *op_get() override {
if (s->info.args.exists("query")) {
- return new RGWMetadataSearch_ObjStore_S3(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_sync_module());
+ return new RGWMetadataSearch_ObjStore_S3(store->get_sync_module());
}
if (!s->init_state.url_bucket.empty() &&
s->info.args.exists("mdsearch")) {
return -EINVAL;
}
- const auto psmodule = static_cast<RGWPSSyncModuleInstance*>(static_cast<rgw::sal::RGWRadosStore*>(store)->getRados()->get_sync_module().get());
+ const auto psmodule = static_cast<RGWPSSyncModuleInstance*>(store->get_sync_module().get());
const auto& conf = psmodule->get_effective_conf();
dest.push_endpoint = s->info.args.get("push-endpoint");