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

« back to all changes in this revision

Viewing changes to src/rgw/rgw_rados.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (0.3.9)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: package-import@ubuntu.com-20120608155437-30vek4y2gu92vhad
Tags: upstream-0.44.1
ImportĀ upstreamĀ versionĀ 0.44.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
  uint64_t size;
19
19
  time_t mtime;
20
20
  bufferlist obj_tag;
 
21
  RGWObjManifest manifest;
 
22
  bool has_manifest;
21
23
  string shadow_obj;
22
24
  bool has_data;
23
25
  bufferlist data;
24
26
  bool prefetch_data;
25
27
 
26
28
  map<string, bufferlist> attrset;
27
 
  RGWObjState() : is_atomic(false), has_attrs(0), exists(false), prefetch_data(false) {}
 
29
  RGWObjState() : is_atomic(false), has_attrs(0), exists(false), has_manifest(false), prefetch_data(false) {}
28
30
 
29
31
  bool get_attr(string name, bufferlist& dest) {
30
32
    map<string, bufferlist>::iterator iter = attrset.find(name);
86
88
    return 0;
87
89
  }
88
90
};
 
91
 
89
92
  
90
93
class RGWRados  : public RGWAccess
91
94
{
144
147
                 bool exclusive,
145
148
                 pair<string, bufferlist> *cmp_xattr);
146
149
  int delete_obj_impl(void *ctx, rgw_obj& src_obj, bool sync);
 
150
  int complete_atomic_overwrite(RGWRadosCtx *rctx, RGWObjState *state, rgw_obj& obj);
147
151
 
148
152
  int select_bucket_placement(std::string& bucket_name, rgw_bucket& bucket);
149
153
  int store_bucket_info(RGWBucketInfo& info, map<string, bufferlist> *pattrs, bool exclusive);
196
200
  /** Write/overwrite an object to the bucket storage. */
197
201
  virtual int put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, time_t *mtime,
198
202
              map<std::string, bufferlist>& attrs, RGWObjCategory category, bool exclusive,
199
 
              map<std::string, bufferlist>* rmattrs, const bufferlist *data);
 
203
              map<std::string, bufferlist>* rmattrs, const bufferlist *data,
 
204
              RGWObjManifest *manifest);
200
205
  virtual int put_obj_data(void *ctx, rgw_obj& obj, const char *data,
201
206
              off_t ofs, size_t len, bool exclusive);
202
207
  virtual int aio_put_obj_data(void *ctx, rgw_obj& obj, bufferlist& bl,
264
269
  /** Set an attr on an object. */
265
270
  virtual int set_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& bl);
266
271
 
 
272
  virtual int set_attrs(void *ctx, rgw_obj& obj,
 
273
                        map<string, bufferlist>& attrs,
 
274
                        map<string, bufferlist>* rmattrs);
 
275
 
267
276
  /** Get data about an object out of RADOS and into memory. */
268
277
  virtual int prepare_get_obj(void *ctx, rgw_obj& obj,
269
278
            off_t *ofs, off_t *end,
287
296
 
288
297
  virtual int obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime, map<string, bufferlist> *attrs, bufferlist *first_chunk);
289
298
 
290
 
  virtual bool supports_tmap() { return true; }
291
 
  virtual int tmap_get(rgw_obj& obj, bufferlist& header, std::map<string, bufferlist>& m);
292
 
  virtual int tmap_set(rgw_obj& obj, std::string& key, bufferlist& bl);
293
 
  virtual int tmap_set(rgw_obj& obj, map<std::string, bufferlist>& m);
294
 
  virtual int tmap_create(rgw_obj& obj, std::string& key, bufferlist& bl);
295
 
  virtual int tmap_del(rgw_obj& obj, std::string& key);
 
299
  virtual bool supports_omap() { return true; }
 
300
  virtual int omap_get_all(rgw_obj& obj, bufferlist& header, std::map<string, bufferlist>& m);
 
301
  virtual int omap_set(rgw_obj& obj, std::string& key, bufferlist& bl);
 
302
  virtual int omap_set(rgw_obj& obj, map<std::string, bufferlist>& m);
 
303
  virtual int omap_del(rgw_obj& obj, std::string& key);
296
304
  virtual int update_containers_stats(map<string, RGWBucketEnt>& m);
297
305
  virtual int append_async(rgw_obj& obj, size_t size, bufferlist& bl);
298
306
 
334
342
                          RGWObjEnt& ent, RGWObjCategory category);
335
343
  int cls_obj_complete_add(rgw_bucket& bucket, string& tag, uint64_t epoch, RGWObjEnt& ent, RGWObjCategory category);
336
344
  int cls_obj_complete_del(rgw_bucket& bucket, string& tag, uint64_t epoch, string& name);
337
 
  int cls_bucket_list(rgw_bucket& bucket, string start, uint32_t num,
 
345
  int cls_obj_complete_cancel(rgw_bucket& bucket, string& tag, string& name);
 
346
  int cls_bucket_list(rgw_bucket& bucket, string start, string prefix, uint32_t num,
338
347
                      map<string, RGWObjEnt>& m, bool *is_truncated,
339
348
                      string *last_entry = NULL);
340
349
  int cls_bucket_head(rgw_bucket& bucket, struct rgw_bucket_dir_header& header);
345
354
  int complete_update_index_del(rgw_bucket& bucket, string& oid, string& tag, uint64_t epoch) {
346
355
    return cls_obj_complete_del(bucket, tag, epoch, oid);
347
356
  }
 
357
  int complete_update_index_cancel(rgw_bucket& bucket, string& oid, string& tag) {
 
358
    return cls_obj_complete_cancel(bucket, tag, oid);
 
359
  }
348
360
 
349
361
  /// clean up/process any temporary objects older than given date[/time]
350
362
  int remove_temp_objects(string date, string time);