MCPcopy Create free account
hub / github.com/ceph/ceph / ec_init_plugin

Method ec_init_plugin

src/erasure-code/consistency/ECEncoder.cc:32–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 */
31template <typename SInfo>
32int ECEncoder<SInfo>::ec_init_plugin(ceph::ErasureCodeInterfaceRef &ec_impl)
33{
34 auto plugin = profile.find("plugin");
35 if (plugin == profile.end()) {
36 std::cerr << "Invalid profile: plugin not specified." << std::endl;
37 return 1;
38 }
39
40 std::stringstream ss;
41 std::string dir = g_conf().get_val<std::string>("erasure_code_dir");
42 ceph::ErasureCodePluginRegistry::instance().factory(plugin->second,
43 dir, profile,
44 &ec_impl, &ss);
45 if (!ec_impl) {
46 std::cerr << "Invalid profile: " << ss.str() << std::endl;
47 return 1;
48 }
49
50 return 0;
51}
52
53/**
54 * Initialize the stripe_info_t needed to perform encode. Optimized version for new EC.

Callers

nothing calls this directly

Calls 5

instanceClass · 0.85
findMethod · 0.45
endMethod · 0.45
factoryMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected