Project

General

Profile

Actions

Feature #11299

open

generic plugin loader framework

Added by Sage Weil about 9 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

our abstract interfaces follow the same pattern:

- abstract pure virtual C++ class interface (e.g., Messenger)
- several implementations that are children of that interface
- each implementation has a simple (e.g., "simple", "async", "xio")
- a factory function that instantiates an instances (e.g., staic Messenger* Messenger::create(string type))

Create a generic framework that can load instances at runtime from .so's:

- a "class" name (like "msgr")
- a location where the .so's are found (default /usr/lib/ceph/$class/$name.so) ?
- .so init functions call a generic function to register themselves (ceph_register_plugin(class, name, create_fn_pointer))
- allow statically compiled instances as well. probably just add a final line to the existing factory function that asks the plugin driver to try to instantiate something (in case the existing ones could handle it).
- do strict version checks as we do with the EC plugins
- move the keyvaluedb, objectstore, and messenger interfaces over to this
- confirm that we can do the same with the ec plugins

Questions:

- sometimes constructors take some extra arguments. how do we pass that through to the plugins? use a void *, and for each interface define a struct that includes any initialization stuff? (the plugins will be compiled against a specific version of this interface anyway)

Actions

Also available in: Atom PDF