数据结构
struct pg_pool_t{
enum {
TYPE_REPLICATED = 1, // 多副本
//TYPE_RAID4 = 2, // raid4 (never implemented)
TYPE_ERASURE = 3, // EC
};
uint64_t flags; //定义了多种flags,例如FLAG_FULL
__u8 type; //多副本或EC
__u8 size, min_size; //副本数和至少保证的副本数
__u8 crush_ruleset; ///< ruleset的id
__u8 object_hash; //映射hash算法
private:
__u32 pg_num, pgp_num; ///< number of pgs
};
class MOSDOp : public Message {
static const int HEAD_VERSION = 5;
static const int COMPAT_VERSION = 3;
private:
uint32_t client_inc; //client id
__u32 osdmap_epoch; //版本号
__u32 flags; //客户端请求带的flags,例如CEPH_OSD_FLAG_ACK
utime_t mtime; //客户端请求所带的mtime
object_t oid; //操作的对象
object_locator_t oloc; //对象的位置信息?
pg_t pgid; //对象所在的pgid
public:
vector<OSDOp> ops; //多个操作集合
……
}
struct OSDOp {
ceph_osd_op op;
sobject_t soid;
bufferlist indata,outdata;
int32_t rval;
};
struct ObjectState {
object_info_t oi;
bool exists;
};
struct ObjectContext {
ObjectState obs;//对象当前的状态
SnapSetContext *ssc;//快照上下文信息
Context *destructor_callback;//对象析构的时候快照相关