return storage_class->data_pool.get_value_or(no_pool);
}
+ const rgw_pool& get_standard_data_pool() const {
+ return get_data_pool(RGW_STORAGE_CLASS_STANDARD);
+ }
const string& get_compression_type(const string& sc) const {
const RGWZoneStorageClass *storage_class;
RGWZonePlacementInfo& pinfo = zone_params->placement_pools[name];
pinfo.index_pool = rgw_pool(name + ".index").to_str();
- pinfo.data_pool = rgw_pool(name + ".data").to_str();
+
+ rgw_pool data_pool(name + ".data");
+ pinfo.storage_classes.set_storage_class(RGW_STORAGE_CLASS_STANDARD, &data_pool, nullptr);
pinfo.data_extra_pool = rgw_pool(name + ".extra").to_str();
-
+
if (is_default) {
- zonegroup->default_placement = name;
+ zonegroup->default_placement = rgw_placement_rule(name, RGW_STORAGE_CLASS_STANDARD);
}
}
test_rgw_env() {
test_rgw_init_env(&zonegroup, &zone_params);
- default_placement.data_pool = rgw_pool(zone_params.placement_pools[zonegroup.default_placement].data_pool);
- default_placement.data_extra_pool = rgw_pool(zone_params.placement_pools[zonegroup.default_placement].data_extra_pool);
+ default_placement.data_pool = rgw_pool(zone_params.placement_pools[zonegroup.default_placement.name].get_standard_data_pool());
+ default_placement.data_extra_pool = rgw_pool(zone_params.placement_pools[zonegroup.default_placement.name].data_extra_pool);
}
rgw_data_placement_target get_placement(const std::string& placement_id) {
const RGWZonePlacementInfo& pi = zone_params.placement_pools[placement_id];
rgw_data_placement_target pt;
pt.index_pool = pi.index_pool;
- pt.data_pool = pi.data_pool;
+ pt.data_pool = pi.get_standard_data_pool();
pt.data_extra_pool = pi.data_extra_pool;
return pt;
}
}
static void gen_obj(test_rgw_env& env, uint64_t obj_size, uint64_t head_max_size, uint64_t stripe_size,
- RGWObjManifest *manifest, const string& placement_id, rgw_bucket *bucket, rgw_obj *head, RGWObjManifest::generator *gen,
+ RGWObjManifest *manifest, const rgw_placement_rule& placement_rule, rgw_bucket *bucket, rgw_obj *head, RGWObjManifest::generator *gen,
list<rgw_obj> *test_objs)
{
manifest->set_trivial_rule(head_max_size, stripe_size);
test_rgw_init_bucket(bucket, "buck");
*head = rgw_obj(*bucket, "oid");
- gen->create_begin(g_ceph_context, manifest, placement_id, *bucket, *head);
+ gen->create_begin(g_ceph_context, manifest, placement_rule, nullptr, *bucket, *head);
append_head(test_objs, *head);
cout << "test_objs.size()=" << test_objs->size() << std::endl;
rgw_obj head;
for (ofs = 0; ofs < part_size; ofs += stripe_size) {
if (ofs == 0) {
- int r = gen.create_begin(g_ceph_context, &manifest, env.zonegroup.default_placement, bucket, head);
+ rgw_placement_rule rule(env.zonegroup.default_placement.name, RGW_STORAGE_CLASS_STANDARD);
+ int r = gen.create_begin(g_ceph_context, &manifest, rule, nullptr, bucket, head);
ASSERT_EQ(r, 0);
continue;
}
for (auto name : { "myobj", "_myobj", "_myobj_"}) {
for (auto inst : { "", "inst"}) {
for (auto ns : { "", "ns"}) {
- test_obj_to_raw(env, b, name, inst, ns, env.zonegroup.default_placement);
+ test_obj_to_raw(env, b, name, inst, ns, env.zonegroup.default_placement.name);
test_obj_to_raw(env, eb, name, inst, ns, string());
}
}