ENCODE_START(7, 7, bl);
{
- ENCODE_START(2, 1, bl); // client-usable data
+ ENCODE_START(3, 1, bl); // client-usable data
::encode(fsid, bl);
::encode(epoch, bl);
::encode(modified, bl);
::encode(new_pg_temp, bl);
::encode(new_primary_temp, bl);
::encode(new_primary_affinity, bl);
+ ::encode(new_erasure_code_profiles, bl);
+ ::encode(old_erasure_code_profiles, bl);
ENCODE_FINISH(bl); // client-usable data
}
return;
}
{
- DECODE_START(2, bl); // client-usable data
+ DECODE_START(3, bl); // client-usable data
::decode(fsid, bl);
::decode(epoch, bl);
::decode(modified, bl);
::decode(new_primary_affinity, bl);
else
new_primary_affinity.clear();
+ if (struct_v >= 3) {
+ ::decode(new_erasure_code_profiles, bl);
+ ::decode(old_erasure_code_profiles, bl);
+ } else {
+ new_erasure_code_profiles.clear();
+ old_erasure_code_profiles.clear();
+ }
DECODE_FINISH(bl); // client-usable data
}
f->close_section();
}
f->close_section();
+
+ OSDMap::dump_erasure_code_profiles(new_erasure_code_profiles, f);
+ f->open_array_section("old_erasure_code_profiles");
+ for (vector<string>::const_iterator p = old_erasure_code_profiles.begin();
+ p != old_erasure_code_profiles.end();
+ p++) {
+ f->dump_string("old", p->c_str());
+ }
+ f->close_section();
}
void OSDMap::Incremental::generate_test_instances(list<Incremental*>& o)
set_primary_affinity(i->first, i->second);
}
+ // erasure_code_profiles
+ for (map<string,map<string,string> >::const_iterator i =
+ inc.new_erasure_code_profiles.begin();
+ i != inc.new_erasure_code_profiles.end();
+ i++) {
+ set_erasure_code_profile(i->first, i->second);
+ }
+
+ for (vector<string>::const_iterator i = inc.old_erasure_code_profiles.begin();
+ i != inc.old_erasure_code_profiles.end();
+ i++)
+ erasure_code_profiles.erase(*i);
+
// up/down
for (map<int32_t,uint8_t>::const_iterator i = inc.new_state.begin();
i != inc.new_state.end();
ENCODE_START(7, 7, bl);
{
- ENCODE_START(2, 1, bl); // client-usable data
+ ENCODE_START(3, 1, bl); // client-usable data
// base
::encode(fsid, bl);
::encode(epoch, bl);
bufferlist cbl;
crush->encode(cbl);
::encode(cbl, bl);
+ ::encode(erasure_code_profiles, bl);
ENCODE_FINISH(bl); // client-usable data
}
* Since we made it past that hurdle, we can use our normal paths.
*/
{
- DECODE_START(2, bl); // client-usable data
+ DECODE_START(3, bl); // client-usable data
// base
::decode(fsid, bl);
::decode(epoch, bl);
::decode(cbl, bl);
bufferlist::iterator cblp = cbl.begin();
crush->decode(cblp);
+ if (struct_v >= 3) {
+ ::decode(erasure_code_profiles, bl);
+ } else {
+ erasure_code_profiles.clear();
+ }
DECODE_FINISH(bl); // client-usable data
}
calc_num_osds();
}
+void OSDMap::dump_erasure_code_profiles(const map<string,map<string,string> > &profiles,
+ Formatter *f)
+{
+ f->open_object_section("erasure_code_profiles");
+ for (map<string,map<string,string> >::const_iterator i = profiles.begin();
+ i != profiles.end();
+ i++) {
+ f->open_object_section(i->first.c_str());
+ for (map<string,string>::const_iterator j = i->second.begin();
+ j != i->second.end();
+ j++) {
+ f->dump_string(j->first.c_str(), j->second.c_str());
+ }
+ f->close_section();
+ }
+ f->close_section();
+}
+
void OSDMap::dump_json(ostream& out) const
{
JSONFormatter jsf(true);
f->dump_stream(ss.str().c_str()) << p->second;
}
f->close_section();
+
+ dump_erasure_code_profiles(erasure_code_profiles, f);
}
void OSDMap::generate_test_instances(list<OSDMap*>& o)
map<int64_t,pg_pool_t> new_pools;
map<int64_t,string> new_pool_names;
set<int64_t> old_pools;
+ map<string,map<string,string> > new_erasure_code_profiles;
+ vector<string> old_erasure_code_profiles;
map<int32_t,entity_addr_t> new_up_client;
map<int32_t,entity_addr_t> new_up_cluster;
map<int32_t,uint8_t> new_state; // XORed onto previous state.
map<int64_t,pg_pool_t> pools;
map<int64_t,string> pool_name;
+ map<string,map<string,string> > erasure_code_profiles;
map<string,int64_t> name_pool;
ceph::shared_ptr< vector<uuid_d> > osd_uuid;
string get_flag_string() const;
static string get_flag_string(unsigned flags);
+ static void dump_erasure_code_profiles(const map<string,map<string,string> > &profiles,
+ Formatter *f);
void dump_json(ostream& out) const;
void dump(Formatter *f) const;
static void generate_test_instances(list<OSDMap*>& o);