Project

General

Profile

Subtask #5878

Updated by Loïc Dachary over 10 years ago

The "abstract API":https://github.com/dachary/ceph/blob/wip-4929/doc/dev/osd_internals/erasure-code.rst#erasure-code-library-abstract-api is provided by dynamically loaded plugins. 
 * core change  
 ** add *ceph osd pool erasure-code-set <pool> <key> <value>* where *<key>* and *<value>* are arbitrary strings. ( see "MonCommands.h":https://github.com/ceph/ceph/blob/master/src/mon/MonCommands.h#L494 for an example ) 
 * configuration 
 ** ceph osd pool set-erasure-code set <pool> plugin-dir erasure-code-plugin-dir /var/lib/ceph/erasure-code-plugins 
 ** ceph osd pool set-erasure-code set <pool> plugin erasure-code-plugin jerasure 
 ** ceph osd pool set-erasure-code set <pool> m erasure-code-m 10 
 ** ceph osd pool set-erasure-code set <pool> k erasure-code-k 3 
 ** ceph osd pool set-erasure-code set <pool> algorithm erasure-code-algorithm Reed-Solomon 
 * src/osd/ErasureCodePlugin.{h,cc} 
 ** class ErasureCodePlugin  
 *** erasure_coding_t *erasure_coding; 
 *** ErasureCodePlugin(g_conf) loads the plugin using the g_conf plugin name previously set with *ceph osd pool set-erasure-code set <pool> plugin erasure-code-plugin <plugin>* , calls create_erasure_code_context(g_conf) and sets the *erasure_coding* data member with the value returned.  
 *** ~ErasureCodePlugin() deletes the *erasure_coding* data member 
 * unit tests 
 ** in the test file ceph osd pool set-erasure-code set <pool> plugin-dir erasure-code-plugin-dir src/test/osd/erasure-code-plugin 
 ** simple minded xor based erasure code plugin that only supports M=2,K=1 
 ** the plugin can be directed to trigger errors for tests purposes 
 ** implement the test plugin to be the basis of a documented example to follow when implementing a new plugin 

Back