67
67
bool system_bucket, bool exclusive = true,
68
68
uint64_t auid = 0) = 0;
69
69
virtual int add_bucket_placement(std::string& new_placement) { return 0; }
70
virtual int remove_bucket_placement(std::string& new_placement) { return 0; }
71
virtual int list_placement_set(set<string>& names) { return 0; }
70
72
virtual int create_pools(vector<string>& names, vector<int>& retcodes, int auid = 0) { return -ENOTSUP; }
71
73
/** write an object to the storage device in the appropriate pool
72
74
with the given stats */
73
75
virtual int put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime,
74
76
map<std::string, bufferlist>& attrs, RGWObjCategory category, bool exclusive,
75
map<std::string, bufferlist>* rmattrs) = 0;
77
map<std::string, bufferlist>* rmattrs,
78
const bufferlist *data) = 0;
76
79
virtual int put_obj_data(void *ctx, rgw_obj& obj, const char *data,
77
off_t ofs, size_t len) = 0;
78
virtual int aio_put_obj_data(void *ctx, rgw_obj& obj, const char *data,
79
off_t ofs, size_t len, void **handle) { return -ENOTSUP; }
80
off_t ofs, size_t len, bool exclusive) = 0;
81
virtual int aio_put_obj_data(void *ctx, rgw_obj& obj, bufferlist& bl,
82
off_t ofs, bool exclusive, void **handle) { return -ENOTSUP; }
81
84
/* note that put_obj doesn't set category on an object, only use it for none user objects */
82
int put_obj(void *ctx, rgw_obj& obj, const char *data, size_t len,
85
int put_obj(void *ctx, rgw_obj& obj, const char *data, size_t len, bool exclusive,
83
86
time_t *mtime, map<std::string, bufferlist>& attrs) {
84
int ret = put_obj_data(ctx, obj, data, -1, len);
86
ret = put_obj_meta(ctx, obj, len, mtime, attrs, RGW_OBJ_CATEGORY_NONE, false, NULL);
89
int ret = put_obj_meta(ctx, obj, len, mtime, attrs, RGW_OBJ_CATEGORY_NONE, exclusive, NULL, &bl);
122
124
* bucket: the name of the bucket to delete
123
125
* Returns 0 on success, -ERR# otherwise.
125
virtual int delete_bucket(rgw_bucket& bucket, bool remove_pool) = 0;
126
virtual int purge_buckets(vector<rgw_bucket>& buckets) { return -ENOTSUP; }
127
virtual int delete_bucket(rgw_bucket& bucket) = 0;
128
129
virtual int set_buckets_enabled(std::vector<rgw_bucket>& buckets, bool enabled) { return -ENOTSUP; }
129
130
virtual int bucket_suspended(rgw_bucket& bucket, bool *suspended) {
233
virtual int obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime, map<string, bufferlist> *attrs) = 0;
234
virtual int obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime, map<string, bufferlist> *attrs, bufferlist *first_chunk) = 0;
235
236
virtual bool supports_tmap() { return false; }
256
257
virtual void *create_context(void *user_ctx) { return NULL; }
257
258
virtual void destroy_context(void *ctx) {}
258
259
virtual void set_atomic(void *ctx, rgw_obj& obj) {}
260
virtual void set_prefetch_data(void *ctx, rgw_obj& obj) {}
260
262
// to notify upper layer that we need to do some operation on an object, and it's up to
261
263
// the upper layer to schedule this operation.. e.g., log intent in intent log
266
268
/* The bucket here can either be the bucket name identifier, or the ID
267
269
* in period format: ".123" */
268
270
virtual int get_bucket_info(void *ctx, string& bucket, RGWBucketInfo& info) = 0;
269
virtual int put_bucket_info(string& bucket_name, RGWBucketInfo& info) = 0;
271
virtual int put_bucket_info(string& bucket_name, RGWBucketInfo& info, bool exclusive) = 0;
272
274
virtual int remove_temp_objects(string date, string time) {