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

Function thread1

src/test/erasure-code/TestErasureCodeShec_thread.cc:90–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90IGNORE_DEPRECATED
91void* thread1(void* pParam)
92{
93 TestParam* param = static_cast<TestParam*>(pParam);
94
95 time_t start, end;
96
97 ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
98
99 instance.disable_dlclose = true;
100 {
101 std::lock_guard l{instance.lock};
102 __erasure_code_init((char*) "shec", (char*) "");
103 }
104 std::cout << "__erasure_code_init finish " << std::endl;
105
106 //encode
107 bufferlist in;
108 set<int> want_to_encode;
109 map<int, bufferlist> encoded;
110
111 in.append("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" //length = 62
112 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"//124
113 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"//186
114 "012345"//192
115 );
116
117 //decode
118 int want_to_decode[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
119 map<int, bufferlist> decoded;
120 bufferlist out1, out2, usable;
121
122 time(&start);
123 time(&end);
124 const int kTestSec = 60;
125 ErasureCodeShecTableCache tcache;
126
127 while (kTestSec >= (end - start)) {
128 //init
129 int r;
130 ErasureCodeShec* shec = new ErasureCodeShecReedSolomonVandermonde(
131 tcache,
132 ErasureCodeShec::MULTIPLE);
133 ErasureCodeProfile *profile = new ErasureCodeProfile();
134 (*profile)["plugin"] = "shec";
135 (*profile)["technique"] = "multiple";
136 (*profile)["crush-failure-domain"] = "osd";
137 (*profile)["k"] = param->k;
138 (*profile)["m"] = param->m;
139 (*profile)["c"] = param->c;
140 (*profile)["w"] = param->w;
141 r = shec->init(*profile, &cerr);
142
143 int i_k = std::atoi(param->k.c_str());
144 int i_m = std::atoi(param->m.c_str());
145 int i_c = std::atoi(param->c.c_str());
146 int i_w = std::atoi(param->w.c_str());
147

Callers

nothing calls this directly

Calls 15

instanceClass · 0.85
__erasure_code_initFunction · 0.70
appendMethod · 0.45
initMethod · 0.45
c_strMethod · 0.45
get_chunk_countMethod · 0.45
insertMethod · 0.45
encodeMethod · 0.45
sizeMethod · 0.45
get_chunk_sizeMethod · 0.45
lengthMethod · 0.45
_decodeMethod · 0.45

Tested by

no test coverage detected