]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fixes following rebase
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 3 Oct 2017 21:58:08 +0000 (14:58 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:03:11 +0000 (08:03 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_period_pusher.cc
src/rgw/rgw_rest_conn.cc
src/rgw/rgw_rest_conn.h
src/rgw/rgw_sync_module_aws.cc
src/rgw/rgw_sync_module_aws.h

index 6bf0f2c2a24b33f5574db49207ebc6c0a355b50e..7072c541368e240de5da7a497da9e5503957fe90 100644 (file)
@@ -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()));
     }
   }
 
index a8871efdd47efebe1e381e603035d9a4d57fb9dc..fa01dcde9861b2ab9aa1af03ad8bb9b183d0bd16 100644 (file)
@@ -6,6 +6,19 @@
 
 #define dout_subsys ceph_subsys_rgw
 
+RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWRados *store,
+                         const string& _remote_id,
+                         const list<string>& 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<string>& remote_endpoints,
index 32c7e673e86ce3f29fe0d0776f1b704348547f34..e0d448777b54e29f12a6fa6d6629d8cd9836ff61 100644 (file)
@@ -60,7 +60,8 @@ class RGWRESTConn
 
 public:
 
-  RGWRESTConn(CephContext *_cct, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred);
+  RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list<string>& endpoints);
+  RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred);
 
   // custom move needed for atomic
   RGWRESTConn(RGWRESTConn&& other);
index 4a9fbfc9e43061721d7ab7bc228a222561461552..39e5eed41710b2cffe3c0ce2d8be6ed95c1f92dc 100644 (file)
@@ -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 <boost/asio/yield.hpp>
+
 #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<string, string>& config,  RGWSyncModuleInstanceRef *instance){
+int RGWAWSSyncModule::create_instance(CephContext *cct, map<string, string, ltstr_nocase>& config,  RGWSyncModuleInstanceRef *instance){
   string s3_endpoint, access_key, secret;
   auto i = config.find("s3_endpoint");
   if (i != config.end())
index d322e9a2bfe9284aa86245ad011b675dec32ebbb..1f80eeaf196244e65a40660160e10e2f77cfb4ac 100644 (file)
@@ -7,7 +7,7 @@ class RGWAWSSyncModule : public RGWSyncModule {
  public:
   RGWAWSSyncModule() {}
   bool supports_data_export() override { return false;}
-  int create_instance(CephContext *cct, map<string, string>& config, RGWSyncModuleInstanceRef *instance) override;
+  int create_instance(CephContext *cct, map<string, string, ltstr_nocase>& config, RGWSyncModuleInstanceRef *instance) override;
 };
 
 #endif /* RGW_SYNC_MODULE_AWS_H */