On Wed, Sep 25, 2013 at 6:40 AM, Chen, Ching-Cheng (KFRM 1) <chingcheng.chen@xxxxxxxxxxxxxxxxx> wrote: > Hi: > > > > I have question regarding using the class plugin API. > > > > We finally able to make a test plugin class worked. We was able to invoke > the exec() call and execute our test plugin class successfully. > > > > However, we have a hard time trying to figure out what object this plugin > class been ran on OSD. I can see there are class API to get attribute, > header, value and even the omap for this object, but we couldn't find any > class API to query which object this plugin is running. > > > > For example, cls_cxx_getxattr() gives you the attribute and > cls_cxx_map_get_all_vals() give you the omap. > > > > We'd like to know how can we obtain the object name this plugin is running. > We have a feeling that we might be able to get it from the > cls_method_context_t, but couldn't figure out why. Huh, you're right; we appear not to expose that right now. If you look at the class_api.cc file you'll see they're turning that cls_method_context_t* into a ReplicatedPG::OpContext*. You can patch that to add a cls_current_object_name() function by doing the same and then going down the OpContext chain (op->obs->oi->soid.oid) — pull requests welcome! :) Or if you want to be really naughty you could do the same inside of your own class, but that would be a bit fragile if the layout changes in the OSD and your class code is built against the old one. -Greg Software Engineer #42 @ http://inktank.com | http://ceph.com _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com