From: Daniel Gryniewicz Date: Thu, 21 Jan 2021 14:40:36 +0000 (-0500) Subject: RGW Zipper - random cleanups X-Git-Tag: v17.1.0~2768^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8aa45ffb702fa8e7d0b8f4f2a0d669945eec62c;p=ceph.git RGW Zipper - random cleanups Signed-off-by: Daniel Gryniewicz --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index cb173b8e5faa..e6436043b9da 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -2644,7 +2644,7 @@ int RGWDataSyncStatusManager::init() 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); diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index b9fa385e946b..36ac9f3115af 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -163,7 +163,7 @@ static RGWRESTMgr *set_logging(RGWRESTMgr *mgr) 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) { @@ -387,7 +387,7 @@ int radosgw_Main(int argc, const char **argv) 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(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 " @@ -446,7 +446,7 @@ int radosgw_Main(int argc, const char **argv) if (! swift_at_root) { rest.register_resource(g_conf()->rgw_swift_url_prefix, - set_logging(rest_filter(static_cast(store)->getRados(), RGW_REST_SWIFT, + set_logging(rest_filter(store, RGW_REST_SWIFT, swift_resource))); } else { if (store->get_zonegroup().zones.size() > 1) { @@ -472,6 +472,7 @@ int radosgw_Main(int argc, const char **argv) /*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); diff --git a/src/rgw/rgw_process.cc b/src/rgw/rgw_process.cc index 6800ff0e5e04..87b62fd9619d 100644 --- a/src/rgw/rgw_process.cc +++ b/src/rgw/rgw_process.cc @@ -209,7 +209,7 @@ int process_request(rgw::sal::RGWStore* const store, s->req_id = static_cast(store)->svc()->zone_utils->unique_id(req->id); s->trans_id = static_cast(store)->svc()->zone_utils->unique_trans_id(req->id); - s->host_id = static_cast(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; diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index 2a6b59b29dd7..bf1224cb7d67 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -847,7 +847,7 @@ void RGWOp_BILog_Status::execute(optional_yield y) } } - const auto& local_zone_id = static_cast(store)->svc()->zone->zone_id(); + const auto& local_zone_id = store->get_zone_id(); if (!merge) { rgw_sync_bucket_pipe pipe; diff --git a/src/rgw/rgw_rest_pubsub.cc b/src/rgw/rgw_rest_pubsub.cc index ce59a39298fa..e05bedadf04c 100644 --- a/src/rgw/rgw_rest_pubsub.cc +++ b/src/rgw/rgw_rest_pubsub.cc @@ -498,8 +498,8 @@ void RGWPSCreateNotif_ObjStore_S3::execute(optional_yield y) { std::string data_bucket_prefix = ""; std::string data_oid_prefix = ""; bool push_only = true; - if (static_cast(store)->getRados()->get_sync_module()) { - const auto psmodule = dynamic_cast(static_cast(store)->getRados()->get_sync_module().get()); + if (store->get_sync_module()) { + const auto psmodule = dynamic_cast(store->get_sync_module().get()); if (psmodule) { const auto& conf = psmodule->get_effective_conf(); data_bucket_prefix = conf["data_bucket_prefix"]; diff --git a/src/rgw/rgw_rest_realm.cc b/src/rgw/rgw_rest_realm.cc index b48999c3826a..b128c9b9ac90 100644 --- a/src/rgw/rgw_rest_realm.cc +++ b/src/rgw/rgw_rest_realm.cc @@ -108,9 +108,9 @@ void RGWOp_Period_Post::execute(optional_yield y) } // require period.realm_id to match our realm - if (period.get_realm() != static_cast(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(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; } diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index b069487cd99b..4a244e0bbd97 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -35,6 +35,8 @@ class RGWListRawObjsCtx; class RGWBucketSyncPolicyHandler; using RGWBucketSyncPolicyHandlerRef = std::shared_ptr; class RGWDataSyncStatusManager; +class RGWSyncModuleInstance; +typedef std::shared_ptr RGWSyncModuleInstanceRef; namespace rgw { class Aio; namespace IAM { struct Policy; } @@ -222,6 +224,8 @@ class RGWStore { 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; diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index e5f25ddd8a0d..01c012503b1f 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -438,6 +438,8 @@ class RGWRadosStore : public RGWStore { 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; diff --git a/src/rgw/rgw_sync_module_es_rest.cc b/src/rgw/rgw_sync_module_es_rest.cc index 61a16904e5e1..280fbd6a673f 100644 --- a/src/rgw/rgw_sync_module_es_rest.cc +++ b/src/rgw/rgw_sync_module_es_rest.cc @@ -381,7 +381,7 @@ class RGWHandler_REST_MDSearch_S3 : public RGWHandler_REST_S3 { protected: RGWOp *op_get() override { if (s->info.args.exists("query")) { - return new RGWMetadataSearch_ObjStore_S3(static_cast(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")) { diff --git a/src/rgw/rgw_sync_module_pubsub_rest.cc b/src/rgw/rgw_sync_module_pubsub_rest.cc index 5acec0a9de8a..440b9ae2ae98 100644 --- a/src/rgw/rgw_sync_module_pubsub_rest.cc +++ b/src/rgw/rgw_sync_module_pubsub_rest.cc @@ -171,7 +171,7 @@ public: return -EINVAL; } - const auto psmodule = static_cast(static_cast(store)->getRados()->get_sync_module().get()); + const auto psmodule = static_cast(store->get_sync_module().get()); const auto& conf = psmodule->get_effective_conf(); dest.push_endpoint = s->info.args.get("push-endpoint");