~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/rgw/rgw_access.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2012-02-05 10:07:38 UTC
  • mfrom: (1.1.7) (0.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120205100738-00s0bxx93mamy8tk
Tags: 0.41-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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; }
80
83
 
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);
85
 
    if (ret >= 0) {
86
 
      ret = put_obj_meta(ctx, obj, len, mtime, attrs, RGW_OBJ_CATEGORY_NONE, false, NULL);
87
 
    }
 
87
    bufferlist bl;
 
88
    bl.append(data, len);
 
89
    int ret = put_obj_meta(ctx, obj, len, mtime, attrs, RGW_OBJ_CATEGORY_NONE, exclusive, NULL, &bl);
88
90
    return ret;
89
91
  }
90
92
 
122
124
   * bucket: the name of the bucket to delete
123
125
   * Returns 0 on success, -ERR# otherwise.
124
126
   */
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;
127
128
 
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) {
163
164
 */
164
165
  virtual int prepare_get_obj(void *ctx,
165
166
            rgw_obj& obj,
166
 
            off_t ofs, off_t *end,
 
167
            off_t *ofs, off_t *end,
167
168
            map<string, bufferlist> *attrs,
168
169
            const time_t *mod_ptr,
169
170
            const time_t *unmod_ptr,
230
231
 /**
231
232
  * stat an object
232
233
  */
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;
234
235
 
235
236
  virtual bool supports_tmap() { return false; }
236
237
 
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) {}
259
261
 
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;
270
272
 
271
273
 
272
274
  virtual int remove_temp_objects(string date, string time) {