]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move RGWBulkDelete in rgw/rgw_op.h.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 9 Nov 2015 16:14:49 +0000 (17:14 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Tue, 8 Dec 2015 16:58:08 +0000 (17:58 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_op.h

index 3ecfbed9859da8e5459230c027737789d1049afc..ce0f70d21d82e9177679d0340970775052aec716 100644 (file)
@@ -197,6 +197,87 @@ public:
   virtual bool need_object_expiration() { return false; }
 };
 
+class RGWBulkDelete : public RGWOp {
+public:
+  struct acct_path_t {
+    std::string bucket_name;
+    rgw_obj_key obj_key;
+  };
+
+  struct fail_desc_t {
+    int err;
+    acct_path_t path;
+  };
+
+  class Deleter {
+  protected:
+    unsigned int num_deleted;
+    unsigned int num_unfound;
+    std::list<fail_desc_t> failures;
+
+    RGWRados * const store;
+    req_state * const s;
+
+  public:
+    Deleter(RGWRados * const str, req_state * const s)
+      : num_deleted(0),
+        num_unfound(0),
+        store(str),
+        s(s) {
+    }
+
+    unsigned int get_num_deleted() const {
+      return num_deleted;
+    }
+
+    unsigned int get_num_unfound() const {
+      return num_unfound;
+    }
+
+    const std::list<fail_desc_t> get_failures() const {
+      return failures;
+    }
+
+    bool verify_permission(RGWBucketInfo& binfo,
+                           map<string, bufferlist>& battrs,
+                           rgw_obj& obj,
+                           ACLOwner& bucket_owner /* out */);
+    bool verify_permission(RGWBucketInfo& binfo,
+                           map<string, bufferlist>& battrs);
+    bool delete_single(const acct_path_t& path);
+    bool delete_chunk(const std::list<acct_path_t>& paths);
+  };
+  /* End of Deleter subclass */
+
+  static const size_t MAX_CHUNK_ENTRIES = 1024;
+
+protected:
+  int ret;
+  std::unique_ptr<Deleter> deleter;
+
+public:
+  RGWBulkDelete()
+    : ret(0),
+      deleter(nullptr) {
+  }
+
+  int verify_permission();
+  void pre_exec();
+  void execute();
+
+  virtual int get_data(std::list<acct_path_t>& items,
+                       bool * is_truncated) = 0;
+  virtual void send_response() = 0;
+
+  virtual const string name() { return "bulk_delete"; }
+  virtual RGWOpType get_type() { return RGW_OP_BULK_DELETE; }
+  virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; }
+};
+
+inline ostream& operator<<(ostream& out, const RGWBulkDelete::acct_path_t &o) {
+  return out << o.bucket_name << "/" << o.obj_key;
+}
+
 #define RGW_LIST_BUCKETS_LIMIT_MAX 10000
 
 class RGWListBuckets : public RGWOp {
@@ -1155,87 +1236,6 @@ public:
 };
 
 
-class RGWBulkDelete : public RGWOp {
-public:
-  struct acct_path_t {
-    std::string bucket_name;
-    rgw_obj_key obj_key;
-  };
-
-  struct fail_desc_t {
-    int err;
-    acct_path_t path;
-  };
-
-  class Deleter {
-  protected:
-    unsigned int num_deleted;
-    unsigned int num_unfound;
-    std::list<fail_desc_t> failures;
-
-    RGWRados * const store;
-    req_state * const s;
-
-  public:
-    Deleter(RGWRados * const str, req_state * const s)
-      : num_deleted(0),
-        num_unfound(0),
-        store(str),
-        s(s) {
-    }
-
-    unsigned int get_num_deleted() const {
-      return num_deleted;
-    }
-
-    unsigned int get_num_unfound() const {
-      return num_unfound;
-    }
-
-    const std::list<fail_desc_t> get_failures() const {
-      return failures;
-    }
-
-    bool verify_permission(RGWBucketInfo& binfo,
-                           map<string, bufferlist>& battrs,
-                           rgw_obj& obj,
-                           ACLOwner& bucket_owner /* out */);
-    bool verify_permission(RGWBucketInfo& binfo,
-                           map<string, bufferlist>& battrs);
-    bool delete_single(const acct_path_t& path);
-    bool delete_chunk(const std::list<acct_path_t>& paths);
-  };
-  /* End of Deleter subclass */
-
-  static const size_t MAX_CHUNK_ENTRIES = 1024;
-
-protected:
-  int ret;
-  std::unique_ptr<Deleter> deleter;
-
-public:
-  RGWBulkDelete()
-    : ret(0),
-      deleter(nullptr) {
-  }
-
-  int verify_permission();
-  void pre_exec();
-  void execute();
-
-  virtual int get_data(std::list<acct_path_t>& items,
-                       bool * is_truncated) = 0;
-  virtual void send_response() = 0;
-
-  virtual const string name() { return "bulk_delete"; }
-  virtual RGWOpType get_type() { return RGW_OP_BULK_DELETE; }
-  virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; }
-};
-
-inline ostream& operator<<(ostream& out, const RGWBulkDelete::acct_path_t &o) {
-  return out << o.bucket_name << "/" << o.obj_key;
-}
-
 class RGWDeleteMultiObj : public RGWOp {
 protected:
   int ret;