Skip to contentSkip to conversation

loadable object classes

DISCUSSION Jack Culpepper 2 participants 2 messages Feb 4, 2010

lore
Share & tools
lore
#0 lore raw

Hey Sage and Ceph folks,

I am trying to understand the loadable class stuff, which seems really cool. I see the objclass directory and cls_crypto.cc seems to be a good example that I could copy and change around.

Does the code in cls_crypto.cc get linked into code at the storage node?

Is it run in userspace?

I see an exec() in librados.cc, and then testrados.c seems to be the place where I would add a driver program to call whatever class I add?

You link to openssl for the crypto. Is it ok to link to other, possibly huge libraries?

On the test system, will there be a special place to store the libraries my class needs?

Thanks!

Jack

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

#1 lore raw

Hi Jack!

Quoted 5 lines · Jack Culpepper

I am trying to understand the loadable class stuff, which seems really cool. I see the objclass directory and cls_crypto.cc seems to be a good example that I could copy and change around.

Does the code in cls_crypto.cc get linked into code at the storage node?

Yeah, the storage daemon will do a dlopen() to link in the .so.

Quoted 1 line

Is it run in userspace?

Yep.

Quoted 2 lines

I see an exec() in librados.cc, and then testrados.c seems to be the place where I would add a driver program to call whatever class I add?

Right.

Quoted 2 lines

You link to openssl for the crypto. Is it ok to link to other, possibly huge libraries?

Yeah, so long as you keep in mind it'll get loaded into all instances of the cosd storage daemon.

Quoted 2 lines

On the test system, will there be a special place to store the libraries my class needs?

The system manages the library of loaded classes internally. You load them into the system with something like

$ ./ceph class add crypto 1 x86-64 -i libcls_crypto.so

where 1 is the version, x86-64 is the arch. (Note that it may take a few seconds for the classes to propagate to all nodes.) If you have multiple versions loaded, you need to explicitly activate the version you want. See

$ ./ceph class list
$ ./ceph class activate crypto 2 

etc.

If you load the libcls_acl.so and libcls_crypto.so classes, testradospp will test them.

It's pretty rough around the edges (hasn't seen a lot of testing). We're definitely interested in hearing how it works for you (in terms of the api and everything else)!

sage

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com