]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: sync aws module compiles
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 21 Feb 2017 16:46:16 +0000 (17:46 +0100)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:03:10 +0000 (08:03 -0700)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_sync_module_aws.cc

index 2c94432abb1e19a9ca2c06b3d8ea34b7569a1269..33dc0f548f2892457a92cf452e526800429e48ca 100644 (file)
@@ -19,3 +19,52 @@ static string aws_object_name(const RGWBucketInfo& bucket_info, const rgw_obj_ke
   }
   return obj_name;
 }
+
+struct AWSConfig {
+  string id;
+  RGWRESTConn *conn{nullptr};
+};
+
+// maybe use Fetch Remote Obj instead?
+class RGWAWSHandleRemoteObjCBCR: public RGWStatRemoteObjCBCR {
+  const AWSConfig& conf;
+public:
+  RGWAWSHandleRemoteObjCBCR(RGWDataSyncEnv *_sync_env,
+                            RGWBucketInfo& _bucket_info,
+                            rgw_obj_key& _key,
+                            const AWSConfig& _conf) : RGWStatRemoteObjCBCR(_sync_env, _bucket_info, _key),
+                                                         conf(_conf) {}
+  int operate () override {
+    auto store = sync_env->store;
+    RGWRESTConn *conn = store->rest_master_conn;
+    if (conn == nullptr)
+      return -EIO;
+
+    reenter(this) {
+      ldout(sync_env->cct, 0) << "SYNC_BEGIN: stat of remote obj z=" << sync_env->source_zone
+                              << " b=" << bucket_info.bucket << " k=" << key << " size=" << size
+                              << " mtime=" << mtime << " attrs=" << attrs
+                              << dendl;
+
+      yield {
+        // and here be dragons!
+        // ultimately we should be using a form of  fetch obj that doesn't write to rados maybe?
+
+        ldout(store->ctx(),0) << "abhi: If you're reading this, wait till things work!" << dendl;
+        string obj_path = bucket_info.bucket.name + "/" + key.name;
+        string res = nullptr;
+        call(new RGWReadRESTResourceCR<string>(sync_env->cct,
+                                               conn,
+                                               sync_env->http_manager,
+                                               obj_path,
+                                               nullptr,
+                                               &res));
+        ldout(store->ctx(),0) << "abhi, printing obj" << dendl;
+        ldout(store->ctx(),0) << res << dendl;
+
+      }
+
+
+    }
+  }
+};