return -EBUSY;
}
- int num_source_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ int num_source_shards = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
if (num_shards <= num_source_shards && !yes_i_really_mean_it) {
cerr << "num shards is less or equal to current shards count" << std::endl
boost::optional<string> index_pool;
boost::optional<string> data_pool;
boost::optional<string> data_extra_pool;
- RGWBucketIndexType placement_index_type = RGWBIType_Normal;
+ rgw::BucketIndexType placement_index_type = rgw::BucketIndexType::Normal;
bool index_type_specified = false;
boost::optional<std::string> compression_type;
data_extra_pool = val;
} else if (ceph_argparse_witharg(args, i, &val, "--placement-index-type", (char*)NULL)) {
if (val == "normal") {
- placement_index_type = RGWBIType_Normal;
+ placement_index_type = rgw::BucketIndexType::Normal;
} else if (val == "indexless") {
- placement_index_type = RGWBIType_Indexless;
+ placement_index_type = rgw::BucketIndexType::Indexless;
} else {
- placement_index_type = (RGWBucketIndexType)strict_strtol(val.c_str(), 10, &err);
+ placement_index_type = (rgw::BucketIndexType)strict_strtol(val.c_str(), 10, &err);
if (!err.empty()) {
cerr << "ERROR: failed to parse index type index: " << err << std::endl;
return EINVAL;
max_entries = 1000;
}
- int max_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ int max_shards = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
formatter->open_array_section("entries");
int i = (specified_shard_id ? shard_id : 0);
for (; i < max_shards; i++) {
RGWRados::BucketShard bs(store->getRados());
- int shard_id = (bucket_info.num_shards > 0 ? i : -1);
+ int shard_id = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? i : -1);
int ret = bs.init(bucket, shard_id, nullptr /* no RGWBucketInfo */);
marker.clear();
return EINVAL;
}
- int max_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ int max_shards = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
for (int i = 0; i < max_shards; i++) {
RGWRados::BucketShard bs(store->getRados());
- int shard_id = (bucket_info.num_shards > 0 ? i : -1);
+ int shard_id = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? i : -1);
int ret = bs.init(bucket, shard_id, nullptr /* no RGWBucketInfo */);
if (ret < 0) {
cerr << "ERROR: bs.init(bucket=" << bucket << ", shard=" << shard_id << "): " << cpp_strerror(-ret) << std::endl;
return ret;
}
- int num_source_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ int num_source_shards = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
RGWReshard reshard(store);
cls_rgw_reshard_entry entry;
return r;
}
- int shards_num = bucket_info.num_shards? bucket_info.num_shards : 1;
- int shard_id = bucket_info.num_shards? 0 : -1;
+ int shards_num = bucket_info.layout.current_index.layout.normal.num_shards? bucket_info.layout.current_index.layout.normal.num_shards : 1;
+ int shard_id = bucket_info.layout.current_index.layout.normal.num_shards? 0 : -1;
if (!sync) {
r = store->svc()->bilog_rados->log_stop(bucket_info, -1);
formatter->open_object_section("stats");
formatter->dump_string("bucket", bucket.name);
- formatter->dump_int("num_shards", bucket_info.num_shards);
+ formatter->dump_int("num_shards", bucket_info.layout.current_index.layout.normal.num_shards);
formatter->dump_string("tenant", bucket.tenant);
formatter->dump_string("zonegroup", bucket_info.zonegroup);
formatter->dump_string("placement_rule", bucket_info.placement_rule.to_str());
::encode_json("explicit_placement", bucket.explicit_placement, formatter);
formatter->dump_string("id", bucket.bucket_id);
formatter->dump_string("marker", bucket.marker);
- formatter->dump_stream("index_type") << bucket_info.index_type;
+ formatter->dump_stream("index_type") << bucket_info.layout.current_index.layout.type;
::encode_json("owner", bucket_info.owner, formatter);
formatter->dump_string("ver", bucket_ver);
formatter->dump_string("master_ver", master_ver);
num_objects += s.second.num_objects;
}
- num_shards = info.num_shards;
+ num_shards = info.layout.current_index.layout.normal.num_shards;
uint64_t objs_per_shard =
(num_shards) ? num_objects/num_shards : num_objects;
{
static int purge_bucket_instance(rgw::sal::RGWRadosStore *store, const RGWBucketInfo& bucket_info)
{
- int max_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ int max_shards = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
for (int i = 0; i < max_shards; i++) {
RGWRados::BucketShard bs(store->getRados());
- int shard_id = (bucket_info.num_shards > 0 ? i : -1);
+ int shard_id = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? i : -1);
int ret = bs.init(bucket_info.bucket, shard_id, nullptr);
if (ret < 0) {
cerr << "ERROR: bs.init(bucket=" << bucket_info.bucket << ", shard=" << shard_id
return ret;
}
}
- bci.info.index_type = rule_info.index_type;
+ bci.info.layout.current_index.layout.type = rule_info.index_type;
} else {
/* existing bucket, keep its placement */
bci.info.bucket.explicit_placement = old_bci->info.bucket.explicit_placement;
encode(placement_rule, bl);
encode(has_instance_obj, bl);
encode(quota, bl);
- encode(num_shards, bl);
- encode(bucket_index_shard_hash_type, bl);
+ encode(layout.current_index.layout.normal.num_shards, bl);
+ encode(layout.current_index.layout.normal.hash_type, bl);
encode(requester_pays, bl);
encode(owner.tenant, bl);
encode(has_website, bl);
if (has_website) {
encode(website_conf, bl);
}
- encode((uint32_t)index_type, bl);
+ encode((uint32_t)layout.current_index.layout.type, bl);
encode(swift_versioning, bl);
if (swift_versioning) {
encode(swift_ver_location, bl);
if (struct_v >= 9)
decode(quota, bl);
if (struct_v >= 10)
- decode(num_shards, bl);
+ decode(layout.current_index.layout.normal.num_shards, bl);
if (struct_v >= 11)
- decode(bucket_index_shard_hash_type, bl);
+ decode(layout.current_index.layout.normal.hash_type, bl);
if (struct_v >= 12)
decode(requester_pays, bl);
if (struct_v >= 13)
if (struct_v >= 15) {
uint32_t it;
decode(it, bl);
- index_type = (RGWBucketIndexType)it;
+ layout.current_index.layout.type = (rgw::BucketIndexType)it;
} else {
- index_type = RGWBIType_Normal;
+ layout.current_index.layout.type = rgw::BucketIndexType::Normal;
}
swift_versioning = false;
swift_ver_location.clear();
BUCKET_OBJ_LOCK_ENABLED = 0X20,
};
-enum RGWBucketIndexType {
- RGWBIType_Normal = 0,
- RGWBIType_Indexless = 1,
-};
-
-inline ostream& operator<<(ostream& out, const RGWBucketIndexType &index_type)
+inline ostream& operator<<(ostream& out, const rgw::BucketIndexType &index_type)
{
switch (index_type) {
- case RGWBIType_Normal:
+ case rgw::BucketIndexType::Normal:
return out << "Normal";
- case RGWBIType_Indexless:
+ case rgw::BucketIndexType::Indexless:
return out << "Indexless";
default:
return out << "Unknown";
// - value of 0 indicates there is no sharding (this is by default
// before this feature is implemented).
// - value of UINT32_T::MAX indicates this is a blind bucket.
- uint32_t num_shards{0};
-
- // Represents the bucket index shard hash type.
- uint8_t bucket_index_shard_hash_type{MOD};
// Represents the shard number for blind bucket.
const static uint32_t NUM_SHARDS_BLIND_BUCKET;
bool has_website{false};
RGWBucketWebsiteConf website_conf;
- RGWBucketIndexType index_type = RGWBIType_Normal;
-
bool swift_versioning{false};
string swift_ver_location;
call(new RGWReadRESTResourceCR<bucket_instance_meta_info>(sync_env->cct, sc->conn, sync_env->http_manager, path, pairs, &meta_info));
}
- num_shards = meta_info.data.get_bucket_info().num_shards;
+ num_shards = meta_info.data.get_bucket_info().layout.current_index.layout.normal.num_shards;
if (num_shards > 0) {
for (i = 0; i < num_shards; i++) {
char buf[16];
conn = _conn;
source_zone = _source_zone;
- int num_shards = (source_bucket_info.num_shards <= 0 ? 1 : source_bucket_info.num_shards);
+ int num_shards = (source_bucket_info.layout.current_index.layout.normal.num_shards <= 0 ?
+ 1 : source_bucket_info.layout.current_index.layout.normal.num_shards);
sync_pairs.resize(num_shards);
- int cur_shard = std::min<int>(source_bucket_info.num_shards, 0);
+ int cur_shard = std::min<int>(source_bucket_info.layout.current_index.layout.normal.num_shards, 0);
for (int i = 0; i < num_shards; ++i, ++cur_shard) {
auto& sync_pair = sync_pairs[i];
sync_pair.source_bs.bucket = source_bucket_info.bucket;
sync_pair.dest_bs.bucket = dest_bucket;
- sync_pair.source_bs.shard_id = (source_bucket_info.num_shards > 0 ? cur_shard : -1);
+ sync_pair.source_bs.shard_id = (source_bucket_info.layout.current_index.layout.normal.num_shards > 0 ? cur_shard : -1);
if (dest_bucket == source_bucket_info.bucket) {
sync_pair.dest_bs.shard_id = sync_pair.source_bs.shard_id;
{
ldpp_dout(sync_env->dpp, 20) << __func__ << "(): sync pipe=" << *siter << dendl;
- source_num_shards = siter->source.get_bucket_info().num_shards;
- target_num_shards = siter->target.get_bucket_info().num_shards;
+ source_num_shards = siter->source.get_bucket_info().layout.current_index.layout.normal.num_shards;
+ target_num_shards = siter->target.get_bucket_info().layout.current_index.layout.normal.num_shards;
if (source_bs) {
sync_pair.source_bs = *source_bs;
} else {
dest_bucket_info(dest_bucket_info),
i(status->begin()), end(status->end())
{
- shard_to_shard_sync = (source_bucket_info.num_shards == dest_bucket_info.num_shards);
+ shard_to_shard_sync = (source_bucket_info.layout.current_index.layout.normal.num_shards == dest_bucket_info.layout.current_index.layout.normal.num_shards);
- source_bs = rgw_bucket_shard(source_bucket_info.bucket, source_bucket_info.num_shards > 0 ? 0 : -1);
- dest_bs = rgw_bucket_shard(dest_bucket_info.bucket, dest_bucket_info.num_shards > 0 ? 0 : -1);
+ source_bs = rgw_bucket_shard(source_bucket_info.bucket, source_bucket_info.layout.current_index.layout.normal.num_shards > 0 ? 0 : -1);
+ dest_bs = rgw_bucket_shard(dest_bucket_info.bucket, dest_bucket_info.layout.current_index.layout.normal.num_shards > 0 ? 0 : -1);
status->clear();
- status->resize(std::max<size_t>(1, source_bucket_info.num_shards));
+ status->resize(std::max<size_t>(1, source_bucket_info.layout.current_index.layout.normal.num_shards));
i = status->begin();
end = status->end();
encode_json("placement_rule", placement_rule, f);
encode_json("has_instance_obj", has_instance_obj, f);
encode_json("quota", quota, f);
- encode_json("num_shards", num_shards, f);
- encode_json("bi_shard_hash_type", (uint32_t)bucket_index_shard_hash_type, f);
+ encode_json("num_shards", layout.current_index.layout.normal.num_shards, f);
+ encode_json("bi_shard_hash_type", (uint32_t)layout.current_index.layout.normal.hash_type, f);
encode_json("requester_pays", requester_pays, f);
encode_json("has_website", has_website, f);
if (has_website) {
}
encode_json("swift_versioning", swift_versioning, f);
encode_json("swift_ver_location", swift_ver_location, f);
- encode_json("index_type", (uint32_t)index_type, f);
+ encode_json("index_type", (uint32_t)layout.current_index.layout.type, f);
encode_json("mdsearch_config", mdsearch_config, f);
encode_json("reshard_status", (int)reshard_status, f);
encode_json("new_bucket_instance_id", new_bucket_instance_id, f);
placement_rule.from_str(pr);
JSONDecoder::decode_json("has_instance_obj", has_instance_obj, obj);
JSONDecoder::decode_json("quota", quota, obj);
- JSONDecoder::decode_json("num_shards", num_shards, obj);
+ JSONDecoder::decode_json("num_shards", layout.current_index.layout.normal.num_shards, obj);
uint32_t hash_type;
JSONDecoder::decode_json("bi_shard_hash_type", hash_type, obj);
- bucket_index_shard_hash_type = (uint8_t)hash_type;
+ layout.current_index.layout.normal.num_shards = (uint8_t)hash_type;
JSONDecoder::decode_json("requester_pays", requester_pays, obj);
JSONDecoder::decode_json("has_website", has_website, obj);
if (has_website) {
JSONDecoder::decode_json("swift_ver_location", swift_ver_location, obj);
uint32_t it;
JSONDecoder::decode_json("index_type", it, obj);
- index_type = (RGWBucketIndexType)it;
+ layout.current_index.layout.type = (rgw::BucketIndexType)it;
JSONDecoder::decode_json("mdsearch_config", mdsearch_config, obj);
int rs;
JSONDecoder::decode_json("reshard_status", rs, obj);
JSONDecoder::decode_json("data_extra_pool", data_extra_pool, obj);
uint32_t it;
JSONDecoder::decode_json("index_type", it, obj);
- index_type = (RGWBucketIndexType)it;
+ index_type = (rgw::BucketIndexType)it;
/* backward compatibility, these are now defined in storage_classes */
string standard_compression_type;
ldpp_dout(this, 20) << "got creation time: << " << master_info.creation_time << dendl;
pmaster_bucket= &master_info.bucket;
creation_time = master_info.creation_time;
- pmaster_num_shards = &master_info.num_shards;
+ pmaster_num_shards = &master_info.layout.current_index.layout.normal.num_shards;
pobjv = &objv;
obj_lock_enabled = master_info.obj_lock_enabled();
} else {
pmaster_bucket= &master_info.bucket;
creation_time = master_info.creation_time;
- pmaster_num_shards = &master_info.num_shards;
+ pmaster_num_shards = &master_info.layout.current_index.layout.normal.num_shards;
pobjv = &objv;
} else {
pmaster_bucket = nullptr;
info.owner = owner.user_id;
info.zonegroup = zonegroup_id;
info.placement_rule = selected_placement_rule;
- info.index_type = rule_info.index_type;
+ info.layout.current_index.layout.type = rule_info.index_type;
info.swift_ver_location = swift_ver_location;
info.swift_versioning = (!swift_ver_location.empty());
if (pmaster_num_shards) {
- info.num_shards = *pmaster_num_shards;
+ info.layout.current_index.layout.normal.num_shards = *pmaster_num_shards;
} else {
- info.num_shards = bucket_index_max_shards;
+ info.layout.current_index.layout.normal.num_shards = bucket_index_max_shards;
}
- info.bucket_index_shard_hash_type = RGWBucketInfo::MOD;
+ info.layout.current_index.layout.normal.num_shards = RGWBucketInfo::MOD;
info.requester_pays = false;
if (real_clock::is_zero(creation_time)) {
info.creation_time = ceph::real_clock::now();
int RGWRados::get_bucket_stats_async(RGWBucketInfo& bucket_info, int shard_id, RGWGetBucketStats_CB *ctx)
{
int num_aio = 0;
- RGWGetBucketStatsContext *get_ctx = new RGWGetBucketStatsContext(ctx, bucket_info.num_shards ? : 1);
+ RGWGetBucketStatsContext *get_ctx = new RGWGetBucketStatsContext(ctx, bucket_info.layout.current_index.layout.normal.num_shards ? : 1);
ceph_assert(get_ctx);
int r = cls_bucket_head_async(bucket_info, shard_id, get_ctx, &num_aio);
if (r < 0) {
bool need_resharding = false;
uint32_t num_source_shards =
- (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
const uint32_t max_dynamic_shards =
uint32_t(cct->_conf.get_val<uint64_t>("rgw_max_dynamic_shards"));
}
ldout(cct, 20) << "RGWRados::" << __func__ << " bucket " << bucket.name <<
- " needs resharding; current num shards " << bucket_info.num_shards <<
+ " needs resharding; current num shards " << bucket_info.layout.current_index.layout.normal.num_shards <<
"; new num shards " << final_num_shards << " (suggested " <<
suggested_num_shards << ")" << dendl;
{
RGWReshard reshard(this->store);
- uint32_t num_source_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ uint32_t num_source_shards = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
new_num_shards = std::min(new_num_shards, get_max_bucket_shards());
if (new_num_shards <= num_source_shards) {
int *shard_id)
{
int r = 0;
- switch (bucket_info.bucket_index_shard_hash_type) {
- case RGWBucketInfo::MOD:
- if (!bucket_info.num_shards) {
+ switch (bucket_info.layout.current_index.layout.normal.hash_type) {
+ case rgw::BucketHashType::Mod:
+ if (!bucket_info.layout.current_index.layout.normal.num_shards) {
if (shard_id) {
*shard_id = -1;
}
} else {
- uint32_t sid = svc.bi_rados->bucket_shard_index(obj_key, bucket_info.num_shards);
+ uint32_t sid = svc.bi_rados->bucket_shard_index(obj_key, bucket_info.layout.current_index.layout.normal.num_shards);
if (shard_id) {
*shard_id = (int)sid;
}
UpdateIndex(RGWRados::Bucket *_target, const rgw_obj& _obj) : target(_target), obj(_obj),
bs(target->get_store()) {
- blind = (target->get_bucket_info().index_type == RGWBIType_Indexless);
+ blind = (target->get_bucket_info().layout.current_index.layout.type == rgw::BucketIndexType::Indexless);
}
int get_bucket_shard(BucketShard **pbs) {
store(_store), bucket_info(_bucket_info), bs(store->getRados()),
aio_completions(_completions)
{
- num_shard = (bucket_info.num_shards > 0 ? _num_shard : -1);
+ num_shard = (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? _num_shard : -1);
bs.init(bucket_info.bucket, num_shard, nullptr /* no RGWBucketInfo */);
max_aio_completions =
int RGWBucketReshard::clear_index_shard_reshard_status(rgw::sal::RGWRadosStore* store,
const RGWBucketInfo& bucket_info)
{
- uint32_t num_shards = bucket_info.num_shards;
+ uint32_t num_shards = bucket_info.layout.current_index.layout.normal.num_shards;
if (num_shards < std::numeric_limits<uint32_t>::max()) {
int ret = set_resharding_status(store, bucket_info,
store->getRados()->create_bucket_id(&new_bucket_info.bucket.bucket_id);
- new_bucket_info.num_shards = new_num_shards;
+ new_bucket_info.layout.current_index.layout.normal.num_shards = new_num_shards;
new_bucket_info.objv_tracker.clear();
new_bucket_info.new_bucket_instance_id.clear();
return ret;
}
- int num_target_shards = (new_bucket_info.num_shards > 0 ? new_bucket_info.num_shards : 1);
+ int num_target_shards = (new_bucket_info.layout.current_index.layout.normal.num_shards > 0 ? new_bucket_info.layout.current_index.layout.normal.num_shards : 1);
BucketReshardManager target_shards_mgr(store, new_bucket_info, num_target_shards);
}
const int num_source_shards =
- (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
+ (bucket_info.layout.current_index.layout.normal.num_shards > 0 ? bucket_info.layout.current_index.layout.normal.num_shards : 1);
string marker;
for (int i = 0; i < num_source_shards; ++i) {
bool is_truncated = true;
// initialize each shard with the maximum marker, which is only used when
// there are no peers syncing from us
- min_markers.assign(std::max(1u, pbucket_info->num_shards),
+ min_markers.assign(std::max(1u, pbucket_info->layout.current_index.layout.normal.num_shards),
RGWSyncLogTrimCR::max_marker);
// determine the minimum marker for each shard
rgw_pool index_pool;
rgw_pool data_extra_pool; /* if not set we should use data_pool */
RGWZoneStorageClasses storage_classes;
- RGWBucketIndexType index_type;
+ rgw::BucketIndexType index_type;
- RGWZonePlacementInfo() : index_type(RGWBIType_Normal) {}
+ RGWZonePlacementInfo() : index_type(rgw::BucketIndexType::Normal) {}
void encode(bufferlist& bl) const {
ENCODE_START(7, 1, bl);
if (struct_v >= 5) {
uint32_t it;
decode(it, bl);
- index_type = (RGWBucketIndexType)it;
+ index_type = (rgw::BucketIndexType)it;
}
string standard_compression_type;
if (struct_v >= 6) {
{
const rgw_bucket& bucket = bucket_info.bucket;
string plain_id = bucket.name + ":" + bucket.bucket_id;
- if (!bucket_info.num_shards) {
+
+ if (!bucket_info.layout.current_index.layout.normal.num_shards) {
(*result)[0] = plain_id;
} else {
char buf[16];
if (shard_id < 0) {
- for (uint32_t i = 0; i < bucket_info.num_shards; ++i) {
+ for (uint32_t i = 0; i < bucket_info.layout.current_index.layout.normal.num_shards; ++i) {
snprintf(buf, sizeof(buf), ":%d", i);
(*result)[i] = plain_id + buf;
}
} else {
- if ((uint32_t)shard_id > bucket_info.num_shards) {
+ if ((uint32_t)shard_id > bucket_info.layout.current_index.layout.normal.num_shards) {
return;
}
snprintf(buf, sizeof(buf), ":%d", shard_id);
return ret;
}
- get_bucket_index_objects(bucket_oid_base, bucket_info.num_shards, bucket_objs, shard_id);
+ get_bucket_index_objects(bucket_oid_base, bucket_info.layout.current_index.layout.normal.num_shards, bucket_objs, shard_id);
if (bucket_instance_ids) {
get_bucket_instance_ids(bucket_info, shard_id, bucket_instance_ids);
}
string oid;
- ret = get_bucket_index_object(bucket_oid_base, obj_key, bucket_info.num_shards,
- (RGWBucketInfo::BIShardsHashType)bucket_info.bucket_index_shard_hash_type, &oid, shard_id);
+ ret = get_bucket_index_object(bucket_oid_base, obj_key, bucket_info.layout.current_index.layout.normal.num_shards,
+ (RGWBucketInfo::BIShardsHashType)bucket_info.layout.current_index.layout.normal.hash_type, &oid, shard_id);
if (ret < 0) {
ldout(cct, 10) << "get_bucket_index_object() returned ret=" << ret << dendl;
return ret;
string oid;
- get_bucket_index_object(bucket_oid_base, bucket_info.num_shards,
+ get_bucket_index_object(bucket_oid_base, bucket_info.layout.current_index.layout.normal.num_shards,
shard_id, &oid);
*bucket_obj = svc.rados->obj(index_pool, oid);
dir_oid.append(bucket_info.bucket.bucket_id);
map<int, string> bucket_objs;
- get_bucket_index_objects(dir_oid, bucket_info.num_shards, &bucket_objs);
+ get_bucket_index_objects(dir_oid, bucket_info.layout.current_index.layout.normal.num_shards, &bucket_objs);
return CLSRGWIssueBucketIndexInit(index_pool.ioctx(),
bucket_objs,
dir_oid.append(bucket_info.bucket.bucket_id);
std::map<int, std::string> bucket_objs;
- get_bucket_index_objects(dir_oid, bucket_info.num_shards, &bucket_objs);
+ get_bucket_index_objects(dir_oid, bucket_info.layout.current_index.layout.normal.num_shards, &bucket_objs);
return CLSRGWIssueBucketIndexClean(index_pool.ioctx(),
bucket_objs,
bool old_sync_enabled = orig_info.datasync_flag_enabled();
if (old_sync_enabled != new_sync_enabled) {
- int shards_num = info.num_shards? info.num_shards : 1;
- int shard_id = info.num_shards? 0 : -1;
+ int shards_num = info.layout.current_index.layout.normal.num_shards? info.layout.current_index.layout.normal.num_shards : 1;
+ int shard_id = info.layout.current_index.layout.normal.num_shards? 0 : -1;
int ret;
if (!new_sync_enabled) {
rule_info->storage_classes.set_storage_class(RGW_STORAGE_CLASS_STANDARD, &pool, nullptr);
rule_info->data_extra_pool = pool_name;
rule_info->index_pool = pool_name;
- rule_info->index_type = RGWBIType_Normal;
+ rule_info->index_type = rgw::BucketIndexType::Normal;
return 0;
}