void RGWOp_Period_Get::execute(optional_yield y)
{
- string realm_id, realm_name, period_id;
+ string realm_id, period_id;
epoch_t epoch = 0;
RESTArgs::get_string(s, "realm_id", realm_id, &realm_id);
- RESTArgs::get_string(s, "realm_name", realm_name, &realm_name);
RESTArgs::get_string(s, "period_id", period_id, &period_id);
RESTArgs::get_uint32(s, "epoch", 0, &epoch);
period.set_id(period_id);
period.set_epoch(epoch);
- op_ret = period.init(this, driver->ctx(), static_cast<rgw::sal::RadosStore*>(driver)->svc()->sysobj, realm_id, y, realm_name);
+ op_ret = period.init(this, driver->ctx(), static_cast<rgw::sal::RadosStore*>(driver)->svc()->sysobj, realm_id, y);
if (op_ret < 0)
ldpp_dout(this, 5) << "failed to read period" << dendl;
}
<< __PRETTY_FUNCTION__ << ":" << __LINE__
<< " WARNING: Cluster is is misconfigured! "
<< " Zonegroup " << zonegroup.get_name()
- << " (" << zonegroup.get_id() << ") in Realm "
- << period.get_realm_name() << " ( " << period.get_realm() << ") "
+ << " (" << zonegroup.get_id() << ") in Realm id ( "
+ << period.get_realm() << ") "
<< " has no endpoints!" << dendl;
}
for (const auto& [_, zone] : zonegroup.zones) {
<< " ERROR: Cluster is is misconfigured! "
<< " Zone " << zone.name << " (" << zone.id << ") in Zonegroup "
<< zonegroup.get_name() << " ( " << zonegroup.get_id()
- << ") in Realm " << period.get_realm_name()
- << " ( " << period.get_realm() << ") "
+ << ") in Realm id ( " << period.get_realm() << ") "
<< " has no endpoints! Trimming is impossible." << dendl;
retval = false;
}
period->period_map.id = period->id;
period->epoch = FIRST_EPOCH;
period->realm_id = info.id;
- period->realm_name = info.name;
r = cfgstore->create_period(dpp, y, true, *period);
if (r < 0) {
rgw_zone_id master_zone;
std::string realm_id;
- std::string realm_name;
epoch_t realm_epoch{1}; //< realm epoch when period was made current
CephContext *cct{nullptr};
const rgw_zone_id& get_master_zone() const { return master_zone; }
const std::string& get_master_zonegroup() const { return master_zonegroup; }
const std::string& get_realm() const { return realm_id; }
- const std::string& get_realm_name() const { return realm_name; }
const RGWPeriodMap& get_map() const { return period_map; }
RGWPeriodConfig& get_config() { return period_config; }
const RGWPeriodConfig& get_config() const { return period_config; }
int update_latest_epoch(const DoutPrefixProvider *dpp, epoch_t epoch, optional_yield y);
int init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc, const std::string &period_realm_id, optional_yield y,
- const std::string &period_realm_name = "", bool setup_obj = true);
+ bool setup_obj = true);
int init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc, optional_yield y, bool setup_obj = true);
int create(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = true);
encode(master_zonegroup, bl);
encode(period_config, bl);
encode(realm_id, bl);
- encode(realm_name, bl);
ENCODE_FINISH(bl);
}
decode(master_zonegroup, bl);
decode(period_config, bl);
decode(realm_id, bl);
- decode(realm_name, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
return 0;
if (id.empty()) {
- RGWRealm realm(realm_id, realm_name);
+ RGWRealm realm(realm_id);
int ret = realm.init(dpp, cct, sysobj_svc, y);
if (ret < 0) {
- ldpp_dout(dpp, 4) << "RGWPeriod::init failed to init realm " << realm_name << " id " << realm_id << " : " <<
+ ldpp_dout(dpp, 4) << "RGWPeriod::init failed to init realm id " << realm_id << " : " <<
cpp_strerror(-ret) << dendl;
return ret;
}
if (!epoch) {
int ret = use_latest_epoch(dpp, y);
if (ret < 0) {
- ldpp_dout(dpp, 0) << "failed to use_latest_epoch period id " << id << " realm " << realm_name << " id " << realm_id
+ ldpp_dout(dpp, 0) << "failed to use_latest_epoch period id " << id << " realm id " << realm_id
<< " : " << cpp_strerror(-ret) << dendl;
return ret;
}
}
int RGWPeriod::init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc,
- const string& period_realm_id, optional_yield y,
- const string& period_realm_name, bool setup_obj)
+ const string& period_realm_id, optional_yield y, bool setup_obj)
{
cct = _cct;
sysobj_svc = _sysobj_svc;
realm_id = period_realm_id;
- realm_name = period_realm_name;
if (!setup_obj)
return 0;
encode_json("master_zone", master_zone, f);
encode_json("period_config", period_config, f);
encode_json("realm_id", realm_id, f);
- encode_json("realm_name", realm_name, f);
encode_json("realm_epoch", realm_epoch, f);
}
JSONDecoder::decode_json("master_zone", master_zone, obj);
JSONDecoder::decode_json("period_config", period_config, obj);
JSONDecoder::decode_json("realm_id", realm_id, obj);
- JSONDecoder::decode_json("realm_name", realm_name, obj);
JSONDecoder::decode_json("realm_epoch", realm_epoch, obj);
}
// always send out the current period on startup
RGWPeriod period;
// XXX dang
- int r = period.init(dpp, cct, static_cast<rgw::sal::RadosStore* >(driver)->svc()->sysobj, realm_id, y, zone->get_realm_name());
+ int r = period.init(dpp, cct, static_cast<rgw::sal::RadosStore* >(driver)->svc()->sysobj, realm_id, y);
if (r < 0) {
ldpp_dout(dpp, -1) << "failed to load period for realm " << realm_id << dendl;
return;
RGWPeriod period;
if (current_period.empty()) {
/* create new period for the realm */
- ret = period.init(dpp, cct, sysobj_svc, id, y, name, false);
+ ret = period.init(dpp, cct, sysobj_svc, id, y, false);
if (ret < 0 ) {
return ret;
}
}
} else {
period = RGWPeriod(current_period, 0);
- int ret = period.init(dpp, cct, sysobj_svc, id, y, name);
+ int ret = period.init(dpp, cct, sysobj_svc, id, y);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: failed to init period " << current_period << dendl;
return ret;
epoch_t epoch = 0;
RGWPeriod period(period_id, epoch);
- int r = period.init(dpp, cct, sysobj_svc, get_id(), y, get_name());
+ int r = period.init(dpp, cct, sysobj_svc, get_id(), y);
if (r < 0) {
ldpp_dout(dpp, 0) << "WARNING: period init failed: " << cpp_strerror(-r) << " ... skipping" << dendl;
return r;
}
ldpp_dout(dpp, 20) << "realm " << realm->get_name() << " " << realm->get_id() << dendl;
- ret = current_period->init(dpp, cct, sysobj_svc, realm->get_id(), y,
- realm->get_name());
+ ret = current_period->init(dpp, cct, sysobj_svc, realm->get_id(), y);
if (ret < 0 && ret != -ENOENT) {
ldpp_dout(dpp, 0) << "failed reading current period info: " << " " << cpp_strerror(-ret) << dendl;
return ret;