]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove extra RGWMPObj in rgw_multi.h 14619/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 18 Apr 2017 18:08:53 +0000 (14:08 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 18 Apr 2017 18:08:55 +0000 (14:08 -0400)
two separate PRs had done refactoring around RGWMPObj, and it ended up
in two different places. remove the one in rgw_multi.h, because
rgw_rados.h now depends on its definition

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_multi.h

index a2b03bdf5ec6909b411c6614a7d7ef693cc46ee1..953a3624380d0ed3db16aa8a3aaf24c1cbec8106 100644 (file)
@@ -79,70 +79,6 @@ public:
   }
 };
 
-class RGWMPObj {
-  string oid;
-  string prefix;
-  string meta;
-  string upload_id;
-public:
-  RGWMPObj() {}
-  RGWMPObj(const string& _oid, const string& _upload_id) {
-    init(_oid, _upload_id, _upload_id);
-  }
-  void init(const string& _oid, const string& _upload_id) {
-    init(_oid, _upload_id, _upload_id);
-  }
-  void init(const string& _oid, const string& _upload_id, const string& part_unique_str) {
-    if (_oid.empty()) {
-      clear();
-      return;
-    }
-    oid = _oid;
-    upload_id = _upload_id;
-    prefix = oid + ".";
-    meta = prefix + upload_id + MP_META_SUFFIX;
-    prefix.append(part_unique_str);
-  }
-  string& get_meta() { return meta; }
-  string get_part(int num) {
-    char buf[16];
-    snprintf(buf, 16, ".%d", num);
-    string s = prefix;
-    s.append(buf);
-    return s;
-  }
-  string get_part(string& part) {
-    string s = prefix;
-    s.append(".");
-    s.append(part);
-    return s;
-  }
-  string& get_upload_id() {
-    return upload_id;
-  }
-  string& get_key() {
-    return oid;
-  }
-  bool from_meta(string& meta) {
-    int end_pos = meta.rfind('.'); // search for ".meta"
-    if (end_pos < 0)
-      return false;
-    int mid_pos = meta.rfind('.', end_pos - 1); // <key>.<upload_id>
-    if (mid_pos < 0)
-      return false;
-    oid = meta.substr(0, mid_pos);
-    upload_id = meta.substr(mid_pos + 1, end_pos - mid_pos - 1);
-    init(oid, upload_id, upload_id);
-    return true;
-  }
-  void clear() {
-    oid = "";
-    prefix = "";
-    meta = "";
-    upload_id = "";
-  }
-};
-
 extern bool is_v2_upload_id(const string& upload_id);
 
 extern int list_multipart_parts(RGWRados *store, RGWBucketInfo& bucket_info, CephContext *cct,