summaryrefslogtreecommitdiffstats
path: root/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc
diff options
context:
space:
mode:
authorLoic Dachary <ldachary@redhat.com>2015-05-17 00:46:38 +0200
committerLoic Dachary <ldachary@redhat.com>2015-05-25 16:49:44 +0200
commit21036cf086c8a044756b95bc840dd89a9f7a9142 (patch)
tree3ba88a6590ab9be266a5b33fe8843f31e9693a25 /src/erasure-code/jerasure/ErasureCodePluginJerasure.cc
parentMerge pull request #4709 from dachary/wip-shec-corpus (diff)
downloadceph-21036cf086c8a044756b95bc840dd89a9f7a9142.tar.xz
ceph-21036cf086c8a044756b95bc840dd89a9f7a9142.zip
erasure-code: define the ErasureCodeProfile type
Instead of map<string,string>. Make it a non const when initializing an ErasureCodeInterface instance so that it can be modified. Rename parameters into profile for consistency with the user documentation. The parameters name was chosen before the user interface was defined. This cosmetic update is made in the context of larger functional changes to improve error reporting and user interface consistency. The init() method are made to accept non const parameters. It is desirable for them to be able to modify the profile so that is accurately reflects the values that are used. The caller may use this information for better error reporting. Signed-off-by: Loic Dachary <ldachary@redhat.com>
Diffstat (limited to 'src/erasure-code/jerasure/ErasureCodePluginJerasure.cc')
-rw-r--r--src/erasure-code/jerasure/ErasureCodePluginJerasure.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc b/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc
index e5f8b839f68..d461c69ac51 100644
--- a/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc
+++ b/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc
@@ -31,12 +31,12 @@ static ostream& _prefix(std::ostream* _dout)
class ErasureCodePluginJerasure : public ErasureCodePlugin {
public:
- virtual int factory(const map<std::string,std::string> &parameters,
+ virtual int factory(ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code) {
ErasureCodeJerasure *interface;
std::string t;
- if (parameters.find("technique") != parameters.end())
- t = parameters.find("technique")->second;
+ if (profile.find("technique") != profile.end())
+ t = profile.find("technique")->second;
if (t == "reed_sol_van") {
interface = new ErasureCodeJerasureReedSolomonVandermonde();
} else if (t == "reed_sol_r6_op") {
@@ -59,7 +59,7 @@ public:
<< dendl;
return -ENOENT;
}
- interface->init(parameters);
+ interface->init(profile);
*erasure_code = ErasureCodeInterfaceRef(interface);
return 0;
}