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 {
};
-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;