ceph 通过自定义操作的方式来提供丰富的业务逻辑, 例如radosgw的业务逻辑
首先先通过下面方法注册到OSD中
72/* class registration api */
73extern int cls_register(const char *name, cls_handle_t *handle);
74extern int cls_unregister(cls_handle_t);
75
76-extern int cls_register_method(cls_handle_t hclass, const char *method, int flags,
77 cls_method_call_t class_call, cls_method_handle_t *handle);
78extern int cls_unregister_method(cls_method_handle_t handle);
79extern void cls_unregister_filter(cls_filter_handle_t handle);
...
137-extern int cls_register_cxx_method(cls_handle_t hclass, const char *method, int flags,
138 cls_method_cxx_call_t class_call, cls_method_handle_t *handle);
显然一个是用来注册c++ 方法的, 一个是注册c方法的
其中
hclass 是方法组
method 是方法名
flags 是这个方法会请求的锁类型
class_call 是定义的处理函数
handle 作为返回的句柄
客户端需要调用这些方法时
通过调用ObjectOperation::exec 输入方法组,方法名,参数
288 -class CEPH_RADOS_API ObjectOperation
289 {
290 public:
291 ObjectOperation();
292 virtual ~ObjectOperation();
293
294 size_t size();
295 <