stringstream ss;
int r = ErasureCodePluginRegistry::instance().preload(plugins,
directory,
- ss);
+ &ss);
if (r)
derr << ss.str() << dendl;
else
stringstream ss;
int r = ErasureCodePluginRegistry::instance().preload(plugins,
directory,
- ss);
+ &ss);
if (r)
derr << ss.str() << dendl;
else
public:
virtual ~ErasureCodeInterface() {}
+ /**
+ * Initialize the instance according to the content of
+ * **profile**. The **ss** stream is set with debug messages or
+ * error messages, the content of which depend on the
+ * implementation.
+ *
+ * Return 0 on success or a negative errno on error. When
+ * returning on error, the implementation is expected to
+ * provide a human readable explanation in **ss**.
+ *
+ * @param [in] profile a key/value map
+ * @param [out] ss contains informative messages when an error occurs
+ * @return 0 on success or a negative errno on error.
+ */
+ virtual int init(ErasureCodeProfile &profile, ostream *ss) = 0;
+
/**
* Create a new ruleset in **crush** under the name **name**,
* unless it already exists.
int ErasureCodePluginRegistry::factory(const std::string &plugin_name,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
- ostream &ss)
+ ostream *ss)
{
ErasureCodePlugin *plugin;
{
}
}
- return plugin->factory(profile, erasure_code);
+ return plugin->factory(profile, erasure_code, ss);
}
static const char *an_older_version() {
int ErasureCodePluginRegistry::load(const std::string &plugin_name,
const std::string &directory,
ErasureCodePlugin **plugin,
- ostream &ss)
+ ostream *ss)
{
assert(lock.is_locked());
std::string fname = directory + "/" PLUGIN_PREFIX
+ plugin_name + PLUGIN_SUFFIX;
void *library = dlopen(fname.c_str(), RTLD_NOW);
if (!library) {
- ss << "load dlopen(" << fname << "): " << dlerror();
+ *ss << "load dlopen(" << fname << "): " << dlerror();
return -EIO;
}
if (erasure_code_version == NULL)
erasure_code_version = an_older_version;
if (erasure_code_version() != string(CEPH_GIT_NICE_VER)) {
- ss << "expected plugin " << fname << " version " << CEPH_GIT_NICE_VER
- << " but it claims to be " << erasure_code_version() << " instead";
+ *ss << "expected plugin " << fname << " version " << CEPH_GIT_NICE_VER
+ << " but it claims to be " << erasure_code_version() << " instead";
dlclose(library);
return -EXDEV;
}
std::string name = plugin_name;
int r = erasure_code_init(name.c_str(), directory.c_str());
if (r != 0) {
- ss << "erasure_code_init(" << plugin_name
- << "," << directory
- << "): " << cpp_strerror(r);
+ *ss << "erasure_code_init(" << plugin_name
+ << "," << directory
+ << "): " << cpp_strerror(r);
dlclose(library);
return r;
}
} else {
- ss << "load dlsym(" << fname
- << ", " << PLUGIN_INIT_FUNCTION
- << "): " << dlerror();
+ *ss << "load dlsym(" << fname
+ << ", " << PLUGIN_INIT_FUNCTION
+ << "): " << dlerror();
dlclose(library);
return -ENOENT;
}
*plugin = get(plugin_name);
if (*plugin == 0) {
- ss << "load " << PLUGIN_INIT_FUNCTION << "()"
- << "did not register " << plugin_name;
+ *ss << "load " << PLUGIN_INIT_FUNCTION << "()"
+ << "did not register " << plugin_name;
dlclose(library);
return -EBADF;
}
(*plugin)->library = library;
- ss << __func__ << ": " << plugin_name << " ";
+ *ss << __func__ << ": " << plugin_name << " ";
return 0;
}
int ErasureCodePluginRegistry::preload(const std::string &plugins,
const std::string &directory,
- ostream &ss)
+ ostream *ss)
{
Mutex::Locker l(lock);
list<string> plugins_list;
virtual ~ErasureCodePlugin() {}
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code) = 0;
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss) = 0;
};
class ErasureCodePluginRegistry {
int factory(const std::string &plugin,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
- ostream &ss);
+ ostream *ss);
int add(const std::string &name, ErasureCodePlugin *plugin);
int remove(const std::string &name);
int load(const std::string &plugin_name,
const std::string &directory,
ErasureCodePlugin **plugin,
- ostream &ss);
+ ostream *ss);
int preload(const std::string &plugins,
const std::string &directory,
- ostream &ss);
+ ostream *ss);
};
}
// -----------------------------------------------------------------------------
-void
-ErasureCodeIsa::init(ErasureCodeProfile &profile)
+int
+ErasureCodeIsa::init(ErasureCodeProfile &profile, ostream *ss)
{
+ int err = 0;
dout(10) << "technique=" << technique << dendl;
map<string, string>::const_iterator parameter;
parameter = profile.find("ruleset-root");
parameter = profile.find("ruleset-failure-domain");
if (parameter != profile.end())
ruleset_failure_domain = parameter->second;
- ostringstream ss;
- if (parse(profile, &ss))
- derr << ss.str() << dendl;
+ err |= parse(profile, ss);
+ if (err)
+ return err;
prepare();
+ return err;
}
// -----------------------------------------------------------------------------
const map<int, bufferlist> &chunks,
map<int, bufferlist> *decoded);
- void init(ErasureCodeProfile &profile);
+ virtual int init(ErasureCodeProfile &profile, ostream *ss);
virtual void isa_encode(char **data,
char **coding,
ErasureCodeIsaTableCache tcache;
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code)
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss)
{
ErasureCodeIsa *interface;
std::string t = "reed_sol_van";
interface = new ErasureCodeIsaDefault(tcache,
ErasureCodeIsaDefault::kCauchy);
} else {
- derr << "technique=" << t << " is not a valid coding technique. "
+ *ss << "technique=" << t << " is not a valid coding technique. "
<< " Choose one of the following: "
<< "reed_sol_van,"
- << "cauchy" << dendl;
+ << "cauchy" << std::endl;
return -ENOENT;
}
}
- interface->init(profile);
+ int r = interface->init(profile, ss);
+ if (r) {
+ delete interface;
+ return r;
+ }
*erasure_code = ErasureCodeInterfaceRef(interface);
return 0;
}
}
}
-void ErasureCodeJerasure::init(ErasureCodeProfile& profile)
+int ErasureCodeJerasure::init(ErasureCodeProfile& profile, ostream *ss)
{
+ int err = 0;
dout(10) << "technique=" << technique << dendl;
map<string,string>::const_iterator parameter;
parameter = profile.find("ruleset-root");
parameter = profile.find("ruleset-failure-domain");
if (parameter != profile.end())
ruleset_failure_domain = parameter->second;
- ostringstream ss;
- if (parse(profile, &ss))
- derr << ss.str() << dendl;
+ err |= parse(profile, ss);
+ if (err)
+ return err;
prepare();
+ return err;
}
int ErasureCodeJerasure::parse(ErasureCodeProfile &profile,
const map<int, bufferlist> &chunks,
map<int, bufferlist> *decoded);
- void init(ErasureCodeProfile &profile);
+ virtual int init(ErasureCodeProfile &profile, ostream *ss);
virtual void jerasure_encode(char **data,
char **coding,
class ErasureCodePluginJerasure : public ErasureCodePlugin {
public:
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code) {
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss) {
ErasureCodeJerasure *interface;
std::string t;
if (profile.find("technique") != profile.end())
<< dendl;
return -ENOENT;
}
- interface->init(profile);
+ dout(20) << __func__ << ": " << profile << dendl;
+ int r = interface->init(profile, ss);
+ if (r) {
+ delete interface;
+ return r;
+ }
*erasure_code = ErasureCodeInterfaceRef(interface);
return 0;
}
class ErasureCodePluginSelectJerasure : public ErasureCodePlugin {
public:
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code) {
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss) {
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- stringstream ss;
int ret;
string name = "jerasure";
if (profile.count("jerasure-name"))
dout(10) << variant << " plugin" << dendl;
ret = instance.factory(name + "_" + variant, profile, erasure_code, ss);
}
- if (ret)
- derr << ss.str() << dendl;
return ret;
}
};
ErasureCodePlugin *plugin;
stringstream ss;
int r = instance.load(plugin_name + string("_") + variant,
- directory, &plugin, ss);
+ directory, &plugin, &ss);
if (r) {
derr << ss.str() << dendl;
return r;
return 0;
}
-int ErasureCodeLrc::layers_init()
+int ErasureCodeLrc::layers_init(ostream *ss)
{
ErasureCodePluginRegistry ®istry = ErasureCodePluginRegistry::instance();
for (unsigned int i = 0; i < layers.size(); i++) {
layer.chunks = layer.data;
layer.chunks.insert(layer.chunks.end(),
layer.coding.begin(), layer.coding.end());
- stringstream ss;
if (layer.profile.find("k") == layer.profile.end())
layer.profile["k"] = stringify(layer.data.size());
if (layer.profile.find("m") == layer.profile.end())
layer.profile,
&layer.erasure_code,
ss);
- if (err) {
- derr << ss.str() << dendl;
+ if (err)
return err;
- }
}
return 0;
}
if (r)
return r;
- r = layers_init();
+ r = layers_init(ss);
if (r)
return r;
int layers_parse(string description_string,
json_spirit::mArray description,
ostream *ss);
- int layers_init();
+ int layers_init(ostream *ss);
int layers_sanity_checks(string description_string,
ostream *ss) const;
};
#undef dout_prefix
#define dout_prefix _prefix(_dout)
-static ostream& _prefix(std::ostream* _dout)
-{
- return *_dout << "ErasureCodePluginLrc: ";
-}
-
class ErasureCodePluginLrc : public ErasureCodePlugin {
public:
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code) {
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss) {
ErasureCodeLrc *interface;
interface = new ErasureCodeLrc();
- stringstream ss;
assert(profile.count("directory") != 0);
- int r = interface->init(profile, &ss);
+ int r = interface->init(profile, ss);
if (r) {
- derr << ss.str() << dendl;
delete interface;
return r;
}
ErasureCodeShecTableCache tcache;
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code) {
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss) {
ErasureCodeShec *interface;
std::string t = "multiple";
<< dendl;
return -ENOENT;
}
- int r = interface->init(profile);
+ int r = interface->init(profile, ss);
if (r) {
delete interface;
return r;
}
}
-int ErasureCodeShec::init(ErasureCodeProfile &profile)
+int ErasureCodeShec::init(ErasureCodeProfile &profile,
+ ostream *ss)
{
+ int err = 0;
map<string,string>::const_iterator parameter;
parameter = profile.find("ruleset-root");
if (parameter != profile.end())
parameter = profile.find("ruleset-failure-domain");
if (parameter != profile.end())
ruleset_failure_domain = parameter->second;
- int err = parse(profile);
- if (err) {
+ err |= parse(profile);
+ if (err)
return err;
- }
prepare();
- return 0;
+ return err;
}
unsigned int ErasureCodeShec::get_chunk_size(unsigned int object_size) const
const map<int, bufferlist> &chunks,
map<int, bufferlist> *decoded);
- int init(ErasureCodeProfile &profile);
+ virtual int init(ErasureCodeProfile &profile, ostream *ss);
virtual void shec_encode(char **data,
char **coding,
int blocksize) = 0;
return prepare_new_pool(m->name, m->auid, m->crush_rule, ruleset_name,
0, 0,
erasure_code_profile,
- pg_pool_t::TYPE_REPLICATED, 0, ss);
+ pg_pool_t::TYPE_REPLICATED, 0, &ss);
else
return prepare_new_pool(m->name, session->auid, m->crush_rule, ruleset_name,
0, 0,
erasure_code_profile,
- pg_pool_t::TYPE_REPLICATED, 0, ss);
+ pg_pool_t::TYPE_REPLICATED, 0, &ss);
}
int OSDMonitor::crush_rename_bucket(const string& srcname,
int OSDMonitor::crush_ruleset_create_erasure(const string &name,
const string &profile,
int *ruleset,
- stringstream &ss)
+ ostream *ss)
{
int ruleid = osdmap.crush->get_rule_id(name);
if (ruleid != -ENOENT) {
ErasureCodeInterfaceRef erasure_code;
int err = get_erasure_code(profile, &erasure_code, ss);
if (err) {
- ss << "failed to load plugin using profile " << profile << std::endl;
+ *ss << "failed to load plugin using profile " << profile << std::endl;
return err;
}
- err = erasure_code->create_ruleset(name, newcrush, &ss);
+ err = erasure_code->create_ruleset(name, newcrush, ss);
erasure_code.reset();
if (err < 0)
return err;
int OSDMonitor::get_erasure_code(const string &erasure_code_profile,
ErasureCodeInterfaceRef *erasure_code,
- stringstream &ss) const
+ ostream *ss) const
{
if (pending_inc.has_erasure_code_profile(erasure_code_profile))
return -EAGAIN;
ErasureCodeProfile::const_iterator plugin =
profile.find("plugin");
if (plugin == profile.end()) {
- ss << "cannot determine the erasure code plugin"
+ *ss << "cannot determine the erasure code plugin"
<< " because there is no 'plugin' entry in the erasure_code_profile "
<< profile << std::endl;
return -EINVAL;
bool OSDMonitor::erasure_code_profile_in_use(const map<int64_t, pg_pool_t> &pools,
const string &profile,
- ostream &ss)
+ ostream *ss)
{
bool found = false;
for (map<int64_t, pg_pool_t>::const_iterator p = pools.begin();
p != pools.end();
++p) {
if (p->second.erasure_code_profile == profile) {
- ss << osdmap.pool_name[p->first] << " ";
+ *ss << osdmap.pool_name[p->first] << " ";
found = true;
}
}
if (found) {
- ss << "pool(s) are using the erasure code profile '" << profile << "'";
+ *ss << "pool(s) are using the erasure code profile '" << profile << "'";
}
return found;
}
int OSDMonitor::parse_erasure_code_profile(const vector<string> &erasure_code_profile,
map<string,string> *erasure_code_profile_map,
- stringstream &ss)
+ ostream *ss)
{
int r = get_json_str_map(g_conf->osd_pool_default_erasure_code_profile,
- ss,
+ *ss,
erasure_code_profile_map);
if (r)
return r;
int OSDMonitor::prepare_pool_size(const unsigned pool_type,
const string &erasure_code_profile,
unsigned *size, unsigned *min_size,
- stringstream &ss)
+ ostream *ss)
{
int err = 0;
switch (pool_type) {
}
break;
default:
- ss << "prepare_pool_size: " << pool_type << " is not a known pool type";
+ *ss << "prepare_pool_size: " << pool_type << " is not a known pool type";
err = -EINVAL;
break;
}
int OSDMonitor::prepare_pool_stripe_width(const unsigned pool_type,
const string &erasure_code_profile,
uint32_t *stripe_width,
- stringstream &ss)
+ ostream *ss)
{
int err = 0;
switch (pool_type) {
}
break;
default:
- ss << "prepare_pool_stripe_width: "
+ *ss << "prepare_pool_stripe_width: "
<< pool_type << " is not a known pool type";
err = -EINVAL;
break;
const string &erasure_code_profile,
const string &ruleset_name,
int *crush_ruleset,
- stringstream &ss)
+ ostream *ss)
{
if (*crush_ruleset < 0) {
switch (pool_type) {
*crush_ruleset = osdmap.crush->get_osd_pool_default_crush_replicated_ruleset(g_ceph_context);
if (*crush_ruleset < 0) {
// Errors may happen e.g. if no valid ruleset is available
- ss << "No suitable CRUSH ruleset exists";
+ *ss << "No suitable CRUSH ruleset exists";
return *crush_ruleset;
}
} else {
}
break;
default:
- ss << "prepare_pool_crush_ruleset: " << pool_type
+ *ss << "prepare_pool_crush_ruleset: " << pool_type
<< " is not a known pool type";
return -EINVAL;
break;
}
} else {
if (!osdmap.crush->ruleset_exists(*crush_ruleset)) {
- ss << "CRUSH ruleset " << *crush_ruleset << " not found";
+ *ss << "CRUSH ruleset " << *crush_ruleset << " not found";
return -ENOENT;
}
}
int OSDMonitor::get_crush_ruleset(const string &ruleset_name,
int *crush_ruleset,
- stringstream &ss)
+ ostream *ss)
{
int ret;
ret = osdmap.crush->get_rule_id(ruleset_name);
return -EAGAIN;
} else {
//Cannot find it , return error
- ss << "specified ruleset " << ruleset_name << " doesn't exist";
+ *ss << "specified ruleset " << ruleset_name << " doesn't exist";
return ret;
}
}
const string &erasure_code_profile,
const unsigned pool_type,
const uint64_t expected_num_objects,
- stringstream &ss)
+ ostream *ss)
{
if (name.length() == 0)
return -EINVAL;
ErasureCodeInterfaceRef erasure_code;
int k;
stringstream tmp;
- int err = get_erasure_code(p.erasure_code_profile, &erasure_code, tmp);
+ int err = get_erasure_code(p.erasure_code_profile, &erasure_code, &tmp);
if (err == 0) {
k = erasure_code->get_data_chunk_count();
} else {
string name;
cmd_getval(g_ceph_context, cmdmap, "name", name);
- if (erasure_code_profile_in_use(pending_inc.new_pools, name, ss))
+ if (erasure_code_profile_in_use(pending_inc.new_pools, name, &ss))
goto wait;
- if (erasure_code_profile_in_use(osdmap.pools, name, ss)) {
+ if (erasure_code_profile_in_use(osdmap.pools, name, &ss)) {
err = -EBUSY;
goto reply;
}
force = false;
}
map<string,string> profile_map;
- err = parse_erasure_code_profile(profile, &profile_map, ss);
+ err = parse_erasure_code_profile(profile, &profile_map, &ss);
if (err)
goto reply;
if (profile_map.find("plugin") == profile_map.end()) {
}
int ruleset;
- err = crush_ruleset_create_erasure(name, profile, &ruleset, ss);
+ err = crush_ruleset_create_erasure(name, profile, &ruleset, &ss);
if (err < 0) {
switch(err) {
case -EEXIST: // return immediately
if (!implicit_ruleset_creation && ruleset_name != "") {
int ruleset;
- err = get_crush_ruleset(ruleset_name, &ruleset, ss);
+ err = get_crush_ruleset(ruleset_name, &ruleset, &ss);
if (err == -EAGAIN) {
wait_for_finished_proposal(new C_RetryMessage(this, m));
return true;
pg_num, pgp_num,
erasure_code_profile, pool_type,
(uint64_t)expected_num_objects,
- ss);
+ &ss);
if (err < 0) {
switch(err) {
case -EEXIST:
int crush_ruleset_create_erasure(const string &name,
const string &profile,
int *ruleset,
- stringstream &ss);
+ ostream *ss);
int get_crush_ruleset(const string &ruleset_name,
int *crush_ruleset,
- stringstream &ss);
+ ostream *ss);
int get_erasure_code(const string &erasure_code_profile,
ErasureCodeInterfaceRef *erasure_code,
- stringstream &ss) const;
+ ostream *ss) const;
int prepare_pool_crush_ruleset(const unsigned pool_type,
const string &erasure_code_profile,
const string &ruleset_name,
int *crush_ruleset,
- stringstream &ss);
+ ostream *ss);
bool erasure_code_profile_in_use(const map<int64_t, pg_pool_t> &pools,
const string &profile,
- ostream &ss);
+ ostream *ss);
int parse_erasure_code_profile(const vector<string> &erasure_code_profile,
map<string,string> *erasure_code_profile_map,
- stringstream &ss);
+ ostream *ss);
int prepare_pool_size(const unsigned pool_type,
const string &erasure_code_profile,
unsigned *size, unsigned *min_size,
- stringstream &ss);
+ ostream *ss);
int prepare_pool_stripe_width(const unsigned pool_type,
const string &erasure_code_profile,
unsigned *stripe_width,
- stringstream &ss);
+ ostream *ss);
int prepare_new_pool(string& name, uint64_t auid,
int crush_ruleset,
const string &crush_ruleset_name,
const string &erasure_code_profile,
const unsigned pool_type,
const uint64_t expected_num_objects,
- stringstream &ss);
+ ostream *ss);
int prepare_new_pool(MPoolOp *m);
void update_pool_flags(int64_t pool_id, uint64_t flags);
profile.find("plugin")->second,
profile,
&ec_impl,
- ss);
+ &ss);
assert(ec_impl);
return new ECBackend(
l,
public:
virtual ~ErasureCodeExample() {}
+ virtual int init(ErasureCodeProfile &profile, ostream *ss) {
+ return 0;
+ }
+
virtual int create_ruleset(const string &name,
CrushWrapper &crush,
ostream *ss) const {
class ErasureCodePluginExample : public ErasureCodePlugin {
public:
virtual int factory(ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code)
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss)
{
*erasure_code = ErasureCodeInterfaceRef(new ErasureCodeExample());
return 0;
k(_k), m(_m), chunk_size(_chunk_size) {}
virtual ~ErasureCodeTest() {}
+ virtual int init(ErasureCodeProfile &profile, ostream *ss) {
+ return 0;
+ }
+
virtual unsigned int get_chunk_count() const { return k + m; }
virtual unsigned int get_data_chunk_count() const { return k; }
virtual unsigned int get_chunk_size(unsigned int object_size) const {
ErasureCodeProfile profile;
profile["k"] = "2";
profile["m"] = "2";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
string payload(object_size, 'X');
bufferlist in;
ErasureCodeProfile profile;
profile["k"] = "2";
profile["m"] = "2";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
//
// If trying to read nothing, the minimum is empty.
ErasureCodeProfile profile;
profile["k"] = "2";
profile["m"] = "1";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
int k = 2;
ASSERT_EQ(EC_ISA_ADDRESS_ALIGNMENT, Isa.get_chunk_size(1));
ErasureCodeProfile profile;
profile["k"] = "3";
profile["m"] = "1";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
int k = 3;
ASSERT_EQ(EC_ISA_ADDRESS_ALIGNMENT, Isa.get_chunk_size(1));
ErasureCodeProfile profile;
profile["k"] = "2";
profile["m"] = "2";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
unsigned aligned_object_size = Isa.get_alignment() * 2;
{
ErasureCodeProfile profile;
profile["k"] = "12";
profile["m"] = "4";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
int k = 12;
int m = 4;
profile["m"] = "4";
profile["technique"] = "cauchy";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
int k = 12;
int m = 4;
profile["m"] = "4";
profile["technique"] = "cauchy";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
int k = 16;
int m = 4;
ErasureCodeProfile profile;
profile["k"] = "4";
profile["m"] = "1";
- Isa.init(profile);
+ Isa.init(profile, &cerr);
int k = 4;
int m = 1;
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- isa.init(profile);
+ isa.init(profile, &cerr);
int ruleset = isa.create_ruleset("myrule", *c, &ss);
EXPECT_EQ(0, ruleset);
EXPECT_EQ(-EEXIST, isa.create_ruleset("myrule", *c, &ss));
profile["m"] = "2";
profile["w"] = "8";
profile["ruleset-root"] = "BAD";
- isa.init(profile);
+ isa.init(profile, &cerr);
EXPECT_EQ(-ENOENT, isa.create_ruleset("otherrule", *c, &ss));
EXPECT_EQ("root item BAD does not exist", ss.str());
}
profile["m"] = "2";
profile["w"] = "8";
profile["ruleset-failure-domain"] = "WORSE";
- isa.init(profile);
+ isa.init(profile, &cerr);
EXPECT_EQ(-EINVAL, isa.create_ruleset("otherrule", *c, &ss));
EXPECT_EQ("unknown type WORSE", ss.str());
}
profile["packetsize"] = "8";
profile["jerasure-per-chunk-alignment"] =
per_chunk_alignments[per_chunk_alignment];
- jerasure.init(profile);
+ jerasure.init(profile, &cerr);
#define LARGE_ENOUGH 2048
bufferptr in_ptr(buffer::create_page_aligned(LARGE_ENOUGH));
profile["m"] = "2";
profile["w"] = "7";
profile["packetsize"] = "8";
- jerasure.init(profile);
+ jerasure.init(profile, &cerr);
//
// If trying to read nothing, the minimum is empty.
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- jerasure.init(profile);
+ jerasure.init(profile, &cerr);
unsigned aligned_object_size = jerasure.get_alignment() * 2;
{
profile["k"] = "2";
profile["m"] = "2";
profile["w"] = "8";
- jerasure.init(profile);
+ jerasure.init(profile, &cerr);
int ruleset = jerasure.create_ruleset("myrule", *c, &ss);
EXPECT_EQ(0, ruleset);
EXPECT_EQ(-EEXIST, jerasure.create_ruleset("myrule", *c, &ss));
profile["m"] = "2";
profile["w"] = "8";
profile["ruleset-root"] = "BAD";
- jerasure.init(profile);
+ jerasure.init(profile, &cerr);
EXPECT_EQ(-ENOENT, jerasure.create_ruleset("otherrule", *c, &ss));
EXPECT_EQ("root item BAD does not exist", ss.str());
}
profile["m"] = "2";
profile["w"] = "8";
profile["ruleset-failure-domain"] = "WORSE";
- jerasure.init(profile);
+ jerasure.init(profile, &cerr);
EXPECT_EQ(-EINVAL, jerasure.create_ruleset("otherrule", *c, &ss));
EXPECT_EQ("unknown type WORSE", ss.str());
}
json_spirit::mArray description;
EXPECT_EQ(0, lrc.layers_description(profile, &description, &cerr));
EXPECT_EQ(0, lrc.layers_parse(description_string, description, &cerr));
- EXPECT_EQ(0, lrc.layers_init());
+ EXPECT_EQ(0, lrc.layers_init(&cerr));
EXPECT_EQ("5", lrc.layers.front().profile["k"]);
EXPECT_EQ("2", lrc.layers.front().profile["m"]);
EXPECT_EQ("jerasure", lrc.layers.front().profile["plugin"]);
profile["directory"] = ".libs";
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
ErasureCodeInterfaceRef erasure_code;
- stringstream ss;
- instance.factory("hangs", profile, &erasure_code, ss);
+ instance.factory("hangs", profile, &erasure_code, &cerr);
return NULL;
}
};
profile["directory"] = directory;
ErasureCodeInterfaceRef erasure_code;
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- stringstream ss;
EXPECT_FALSE(erasure_code);
- EXPECT_EQ(-EIO, instance.factory("invalid", profile, &erasure_code, ss));
+ EXPECT_EQ(-EIO, instance.factory("invalid", profile, &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
EXPECT_EQ(-EXDEV, instance.factory("missing_version", profile,
- &erasure_code, ss));
+ &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
EXPECT_EQ(-ENOENT, instance.factory("missing_entry_point", profile,
- &erasure_code, ss));
+ &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
EXPECT_EQ(-ESRCH, instance.factory("fail_to_initialize", profile,
- &erasure_code, ss));
+ &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
EXPECT_EQ(-EBADF, instance.factory("fail_to_register", profile,
- &erasure_code, ss));
+ &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
- EXPECT_EQ(0, instance.factory("example", profile, &erasure_code, ss));
+ EXPECT_EQ(0, instance.factory("example", profile, &erasure_code, &cerr));
EXPECT_TRUE(erasure_code);
ErasureCodePlugin *plugin = 0;
{
Mutex::Locker l(instance.lock);
- EXPECT_EQ(-EEXIST, instance.load("example", directory, &plugin, ss));
+ EXPECT_EQ(-EEXIST, instance.load("example", directory, &plugin, &cerr));
EXPECT_EQ(-ENOENT, instance.remove("does not exist"));
EXPECT_EQ(0, instance.remove("example"));
- EXPECT_EQ(0, instance.load("example", directory, &plugin, ss));
+ EXPECT_EQ(0, instance.load("example", directory, &plugin, &cerr));
}
}
ErasureCodeInterfaceRef erasure_code;
EXPECT_FALSE(erasure_code);
EXPECT_EQ(-EIO, instance.factory("no-isa", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
}
const char *techniques[] = {
profile["technique"] = *technique;
EXPECT_FALSE(erasure_code);
EXPECT_EQ(0, instance.factory("isa", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
EXPECT_TRUE(erasure_code);
}
}
ErasureCodeInterfaceRef erasure_code;
EXPECT_FALSE(erasure_code);
EXPECT_EQ(-ENOENT, instance.factory("jerasure", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
EXPECT_FALSE(erasure_code);
}
const char *techniques[] = {
profile["technique"] = *technique;
EXPECT_FALSE(erasure_code);
EXPECT_EQ(0, instance.factory("jerasure", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
EXPECT_TRUE(erasure_code);
}
}
ErasureCodeInterfaceRef erasure_code;
int sse4_side_effect = -444;
EXPECT_EQ(sse4_side_effect, instance.factory("jerasure", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
}
// pclmul is missing, load the SSE3 plugin
{
ErasureCodeInterfaceRef erasure_code;
int sse3_side_effect = -333;
EXPECT_EQ(sse3_side_effect, instance.factory("jerasure", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
}
// pclmul and sse3 are missing, load the generic plugin
{
ErasureCodeInterfaceRef erasure_code;
int generic_side_effect = -111;
EXPECT_EQ(generic_side_effect, instance.factory("jerasure", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
}
// neon is set, load the neon plugin
{
ErasureCodeInterfaceRef erasure_code;
int generic_side_effect = -555;
EXPECT_EQ(generic_side_effect, instance.factory("jerasure", profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
}
ErasureCodeInterfaceRef erasure_code;
EXPECT_FALSE(erasure_code);
EXPECT_EQ(0, instance.factory("jerasure_" + *sse_variant, profile,
- &erasure_code, cerr));
+ &erasure_code, &cerr));
EXPECT_TRUE(erasure_code);
//
profile["layers"] = "[ [ \"DDc\", \"\" ] ]";
ErasureCodeInterfaceRef erasure_code;
EXPECT_FALSE(erasure_code);
- EXPECT_EQ(0, instance.factory("lrc", profile, &erasure_code, cerr));
+ EXPECT_EQ(0, instance.factory("lrc", profile, &erasure_code, &cerr));
EXPECT_TRUE(erasure_code);
}
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(6, shec->k);
EXPECT_EQ(4, shec->m);
(*profile)["c"] = "3";
(*profile)["w"] = "8";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
//check profile
EXPECT_EQ(6, shec->k);
(*profile)["c"] = "3";
(*profile)["w"] = "16";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
//check profile
EXPECT_EQ(6, shec->k);
(*profile)["c"] = "3";
(*profile)["w"] = "32";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
//check profile
EXPECT_EQ(6, shec->k);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "-1"; //unexpected value
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "0.1"; //unexpected value
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "a"; //unexpected value
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
//m is not specified
(*profile)["c"] = "3";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
(*profile)["c"] = "-1"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
(*profile)["c"] = "0.1"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
(*profile)["c"] = "a"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "4";
//c is not specified
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["c"] = "3";
(*profile)["w"] = "1"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["c"] = "3";
(*profile)["w"] = "-1"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["c"] = "3";
(*profile)["w"] = "0.1"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["c"] = "3";
(*profile)["w"] = "a"; //unexpected value
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "4";
(*profile)["c"] = "10"; //c > m
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
//m is not specified
//c is not specified
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "8";
(*profile)["c"] = "8";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_TRUE(shec->matrix != NULL);
EXPECT_EQ(0, r);
(*profile)["m"] = "7";
(*profile)["c"] = "7";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "13";
(*profile)["c"] = "13";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "9";
(*profile)["c"] = "8";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["m"] = "12";
(*profile)["c"] = "12";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
EXPECT_EQ(-EINVAL, r);
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
- int r = shec->init(*profile); //init executed twice
+ shec->init(*profile, &cerr);
+ int r = shec->init(*profile, &cerr); //init executed twice
//check profile
EXPECT_EQ(6, shec->k);
(*profile)["c"] = "5";
(*profile)["w"] = "16";
- int r = shec->init(*profile);
+ int r = shec->init(*profile, &cerr);
//reexecute init
(*profile2)["plugin"] = "shec";
(*profile2)["k"] = "6";
(*profile2)["m"] = "4";
(*profile2)["c"] = "3";
- shec->init(*profile2);
+ shec->init(*profile2, &cerr);
EXPECT_EQ(6, shec->k);
EXPECT_EQ(4, shec->m);
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode_with_cost
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//minimum_to_decode_with_cost
set<int> want_to_decode;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
bufferlist in;
in.append("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"//length = 62
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//encode
bufferlist in;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//create_ruleset
stringstream ss;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//create_ruleset
int r = shec->create_ruleset("myrule", *crush, NULL); //ss = NULL
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//create_ruleset
stringstream ss;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//create_ruleset
stringstream ss;
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//get_chunk_count
EXPECT_EQ(10u, shec->get_chunk_count());
(*profile)["k"] = "6";
(*profile)["m"] = "4";
(*profile)["c"] = "3";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//get_data_chunk_count
EXPECT_EQ(6u, shec->get_data_chunk_count());
(*profile)["m"] = "4";
(*profile)["c"] = "3";
(*profile)["w"] = "8";
- shec->init(*profile);
+ shec->init(*profile, &cerr);
//when there is no padding(192=k*w*4)
EXPECT_EQ(32u, shec->get_chunk_size(192));
(*profile)["m"] = m;
(*profile)["c"] = c;
- result = shec->init(*profile);
+ result = shec->init(*profile, &cerr);
//check profile
EXPECT_EQ(i_k, shec->k);
(*profile)["m"] = param->m;
(*profile)["c"] = param->c;
(*profile)["w"] = param->w;
- r = shec->init(*profile);
+ r = shec->init(*profile, &cerr);
int i_k = std::atoi(param->k.c_str());
int i_m = std::atoi(param->m.c_str());
int code = instance.factory(profile["plugin"],
profile,
- &erasure_code, cerr);
+ &erasure_code, &cerr);
if (code)
return code;