首页 > 其他 > 详细

ceph RGW接口源码解析--Rados数据操作

时间:2014-12-11 17:35:54      阅读:1572      评论:0      收藏:0      [点我收藏+]

RGW业务处理流程:

http reqest --> apache 转 FastCgi module

FastCgi module --> radosgw  通过socket请求实现(未确定是否有其它方式)

radosgw --> ceph集群  通过socket实现,调用rados接口


1、数据结构

在Rgw_common.h定义了基本的数据结构,并实现了 decode、encode序列化,方便对rados访问

//桶的权限创建资料

struct RGWBucketInfo 
{
  rgw_bucket bucket;
  string owner;
  uint32_t flags;
  string region;
  time_t creation_time;
  string placement_rule;
  bool has_instance_obj;
  RGWObjVersionTracker objv_tracker; /* we don‘t need to serialize this, for runtime tracking */
  obj_version ep_objv; /* entry point object version, for runtime tracking only */
  RGWQuotaInfo quota;

//桶pool位置存储组成
struct rgw_bucket {
  std::string name;
  std::string data_pool;
  std::string data_extra_pool; /* if not set, then we should use data_pool instead */
  std::string index_pool;
  std::string marker;
  std::string bucket_id;
  std::string oid;
 }

//用户UID资料

struct RGWUserInfo

2、s3元数据原子操作

在rgw_op.h定义元数据的原子操作,RGWOp作为基类

创建桶的原子类定义:class RGWCreateBucket : public RGWOp

3、元数据操作句柄

在Rgw_bucket.h中定义
    class RGWUserBuckets

在Rgw_bucket.cc中实现
  class RGWBucketInstanceMetadataHandler : public RGWMetadataHandler
  class RGWBucketMetadataHandler : public RGWMetadataHandler

4、rados接口实现

在rgw_rados.h 定义了RGWRados,实现了所有与rados相关的操作接口

ceph RGW接口源码解析--Rados数据操作

原文:http://my.oschina.net/u/2271251/blog/355074

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!