]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: expect all plugins to implement get_profile
authorLoic Dachary <ldachary@redhat.com>
Mon, 1 Jun 2015 17:46:50 +0000 (19:46 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 1 Jun 2015 17:52:48 +0000 (19:52 +0200)
Add the get_profile method to the interface and make it a pure virtual.
Each plugin is expected to return the profile currently in use. Although
the profile is also stored in the OSDMap, it provides a convenient
introspection method to validate that the profile being set is indeed
the profile being used.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/erasure-code/ErasureCodeInterface.h

index 1fb962aad5eef4f40e8b72dd1aaf233b6d704dea..865f22479e449b799354f2a9f82e5a888086923c 100644 (file)
@@ -173,6 +173,14 @@ namespace ceph {
      */
     virtual int init(ErasureCodeProfile &profile, ostream *ss) = 0;
 
+    /**
+     * Return the profile that was used to initialize the instance
+     * with the **init** method.
+     *
+     * @return the profile in use by the instance
+     */
+    virtual const ErasureCodeProfile &get_profile() const = 0;
+
     /**
      * Create a new ruleset in **crush** under the name **name**,
      * unless it already exists.