From 0f2c55679610cc9158d83e1dc82edfe0de0302d1 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Mon, 1 Jun 2015 19:46:50 +0200 Subject: [PATCH] erasure-code: expect all plugins to implement get_profile 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 --- src/erasure-code/ErasureCodeInterface.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/erasure-code/ErasureCodeInterface.h b/src/erasure-code/ErasureCodeInterface.h index 1fb962aad5eef..865f22479e449 100644 --- a/src/erasure-code/ErasureCodeInterface.h +++ b/src/erasure-code/ErasureCodeInterface.h @@ -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. -- 2.39.5