From: Yehuda Sadeh Date: Tue, 3 Oct 2017 21:58:08 +0000 (-0700) Subject: rgw: fixes following rebase X-Git-Tag: v13.1.0~270^2~100 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e1ecd2bb607b87e030efe622f39ec753f7731255;p=ceph.git rgw: fixes following rebase Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_period_pusher.cc b/src/rgw/rgw_period_pusher.cc index 6bf0f2c2a24..7072c541368 100644 --- a/src/rgw/rgw_period_pusher.cc +++ b/src/rgw/rgw_period_pusher.cc @@ -245,7 +245,7 @@ void RGWPeriodPusher::handle_notify(RGWZonesNeedPeriod&& period) hint = conns.emplace_hint( hint, std::piecewise_construct, std::forward_as_tuple(zonegroup.get_id()), - std::forward_as_tuple(cct, store, zonegroup.get_id(), zonegroup.endpoints)); + std::forward_as_tuple(cct, store, zonegroup.get_id(), zonegroup.endpoints, RGWAccessKey())); } } diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index a8871efdd47..fa01dcde986 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -6,6 +6,19 @@ #define dout_subsys ceph_subsys_rgw +RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWRados *store, + const string& _remote_id, + const list& remote_endpoints) + : cct(_cct), + endpoints(remote_endpoints.begin(), remote_endpoints.end()), + remote_id(_remote_id) +{ + if (store) { + key = store->get_zone_params().system_key; + self_zone_group = store->get_zonegroup().get_id(); + } +} + RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list& remote_endpoints, diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h index 32c7e673e86..e0d448777b5 100644 --- a/src/rgw/rgw_rest_conn.h +++ b/src/rgw/rgw_rest_conn.h @@ -60,7 +60,8 @@ class RGWRESTConn public: - RGWRESTConn(CephContext *_cct, const string& _remote_id, const list& endpoints, RGWAccessKey _cred); + RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list& endpoints); + RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list& endpoints, RGWAccessKey _cred); // custom move needed for atomic RGWRESTConn(RGWRESTConn&& other); diff --git a/src/rgw/rgw_sync_module_aws.cc b/src/rgw/rgw_sync_module_aws.cc index 4a9fbfc9e43..39e5eed4171 100644 --- a/src/rgw/rgw_sync_module_aws.cc +++ b/src/rgw/rgw_sync_module_aws.cc @@ -2,11 +2,12 @@ #include "rgw_coroutine.h" #include "rgw_sync_module.h" #include "rgw_data_sync.h" -#include "rgw_boost_asio_yield.h" #include "rgw_sync_module_aws.h" #include "rgw_rest_conn.h" #include "rgw_cr_rest.h" +#include + #define dout_subsys ceph_subsys_rgw // TODO: have various bucket naming schemes at a global/user and a bucket level @@ -168,28 +169,41 @@ public: class RGWAWSDataSyncModule: public RGWDataSyncModule { + CephContext *cct; AWSConfig conf; + string s3_endpoint; + RGWAccessKey key; public: - RGWAWSDataSyncModule(CephContext *cct, const string& s3_endpoint, const string& access_key, const string& secret){ + RGWAWSDataSyncModule(CephContext *_cct, const string& _s3_endpoint, const string& access_key, const string& secret) : + cct(_cct), + s3_endpoint(_s3_endpoint), + key(access_key, secret) { + } + + void init(RGWDataSyncEnv *sync_env, uint64_t instance_id) { conf.id = string("s3:") + s3_endpoint; conf.conn.reset(new RGWRESTConn(cct, + sync_env->store, conf.id, { s3_endpoint }, - RGWAccessKey(access_key,secret))); + key)); } ~RGWAWSDataSyncModule() {} - RGWCoroutine *sync_object(RGWDataSyncEnv *sync_env, RGWBucketInfo& bucket_info, rgw_obj_key& key, uint64_t versioned_epoch) override { + RGWCoroutine *sync_object(RGWDataSyncEnv *sync_env, RGWBucketInfo& bucket_info, rgw_obj_key& key, uint64_t versioned_epoch, + rgw_zone_set *zones_trace) override { ldout(sync_env->cct, 0) << conf.id << ": sync_object: b=" << bucket_info.bucket << " k=" << key << " versioned_epoch=" << versioned_epoch << dendl; return new RGWAWSHandleRemoteObjCR(sync_env, bucket_info, key, conf); } - RGWCoroutine *remove_object(RGWDataSyncEnv *sync_env, RGWBucketInfo& bucket_info, rgw_obj_key& key, real_time& mtime, bool versioned, uint64_t versioned_epoch) override { + RGWCoroutine *remove_object(RGWDataSyncEnv *sync_env, RGWBucketInfo& bucket_info, rgw_obj_key& key, real_time& mtime, bool versioned, uint64_t versioned_epoch, + rgw_zone_set *zones_trace) override { ldout(sync_env->cct, 0) <<"rm_object: b=" << bucket_info.bucket << " k=" << key << " mtime=" << mtime << " versioned=" << versioned << " versioned_epoch=" << versioned_epoch << dendl; return new RGWAWSRemoveRemoteObjCBCR(sync_env, bucket_info, key, mtime, conf); } RGWCoroutine *create_delete_marker(RGWDataSyncEnv *sync_env, RGWBucketInfo& bucket_info, rgw_obj_key& key, real_time& mtime, - rgw_bucket_entry_owner& owner, bool versioned, uint64_t versioned_epoch) override { + rgw_bucket_entry_owner& owner, bool versioned, uint64_t versioned_epoch, + rgw_zone_set *zones_trace) override { ldout(sync_env->cct, 0) <<"AWS Not implemented: create_delete_marker: b=" << bucket_info.bucket << " k=" << key << " mtime=" << mtime << " versioned=" << versioned << " versioned_epoch=" << versioned_epoch << dendl; return NULL; @@ -205,7 +219,7 @@ public: } }; -int RGWAWSSyncModule::create_instance(CephContext *cct, map& config, RGWSyncModuleInstanceRef *instance){ +int RGWAWSSyncModule::create_instance(CephContext *cct, map& config, RGWSyncModuleInstanceRef *instance){ string s3_endpoint, access_key, secret; auto i = config.find("s3_endpoint"); if (i != config.end()) diff --git a/src/rgw/rgw_sync_module_aws.h b/src/rgw/rgw_sync_module_aws.h index d322e9a2bfe..1f80eeaf196 100644 --- a/src/rgw/rgw_sync_module_aws.h +++ b/src/rgw/rgw_sync_module_aws.h @@ -7,7 +7,7 @@ class RGWAWSSyncModule : public RGWSyncModule { public: RGWAWSSyncModule() {} bool supports_data_export() override { return false;} - int create_instance(CephContext *cct, map& config, RGWSyncModuleInstanceRef *instance) override; + int create_instance(CephContext *cct, map& config, RGWSyncModuleInstanceRef *instance) override; }; #endif /* RGW_SYNC_MODULE_AWS_H */