#define dout_subsys ceph_subsys_rgw
+using namespace std;
+
// reject 'period push' if we would have to fetch too many intermediate periods
static const uint32_t PERIOD_HISTORY_FETCH_MAX = 64;
period.set_id(period_id);
period.set_epoch(epoch);
- op_ret = period.init(this, store->ctx(), store->svc()->sysobj, realm_id, y, realm_name);
+ op_ret = period.init(this, store->ctx(), static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm_id, y, realm_name);
if (op_ret < 0)
ldpp_dout(this, 5) << "failed to read period" << dendl;
}
return check_caps(s->user->get_caps());
}
const char* name() const override { return "post_period"; }
+ RGWOpType get_type() override { return RGW_OP_PERIOD_POST; }
};
void RGWOp_Period_Post::execute(optional_yield y)
auto cct = store->ctx();
// initialize the period without reading from rados
- period.init(this, cct, store->svc()->sysobj, y, false);
+ period.init(this, cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y, false);
// decode the period from input
const auto max_size = cct->_conf->rgw_max_put_param_size;
bool empty;
- op_ret = rgw_rest_get_json_input(cct, s, period, max_size, &empty);
+ op_ret = get_json_input(cct, s, period, max_size, &empty);
if (op_ret < 0) {
ldpp_dout(this, -1) << "failed to decode period" << dendl;
return;
}
// require period.realm_id to match our realm
- if (period.get_realm() != store->svc()->zone->get_realm().get_id()) {
+ if (period.get_realm() != store->get_zone()->get_realm().get_id()) {
error_stream << "period with realm id " << period.get_realm()
- << " doesn't match current realm " << store->svc()->zone->get_realm().get_id() << std::endl;
+ << " doesn't match current realm " << store->get_zone()->get_realm().get_id() << std::endl;
op_ret = -EINVAL;
return;
}
// period that we haven't restarted with yet. we also don't want to modify
// the objects in use by RGWRados
RGWRealm realm(period.get_realm());
- op_ret = realm.init(this, cct, store->svc()->sysobj, y);
+ op_ret = realm.init(this, cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y);
if (op_ret < 0) {
ldpp_dout(this, -1) << "failed to read current realm: "
<< cpp_strerror(-op_ret) << dendl;
}
RGWPeriod current_period;
- op_ret = current_period.init(this, cct, store->svc()->sysobj, realm.get_id(), y);
+ op_ret = current_period.init(this, cct, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, realm.get_id(), y);
if (op_ret < 0) {
ldpp_dout(this, -1) << "failed to read current period: "
<< cpp_strerror(-op_ret) << dendl;
}
// if it's not period commit, nobody is allowed to push to the master zone
- if (period.get_master_zone() == store->svc()->zone->get_zone_params().get_id()) {
+ if (period.get_master_zone() == store->get_zone()->get_params().get_id()) {
ldpp_dout(this, 10) << "master zone rejecting period id="
<< period.get_id() << " epoch=" << period.get_epoch() << dendl;
op_ret = -EINVAL; // XXX: error code
return;
}
- auto period_history = store->svc()->mdlog->get_period_history();
+ auto period_history = static_cast<rgw::sal::RadosStore*>(store)->svc()->mdlog->get_period_history();
// decide whether we can set_current_period() or set_latest_epoch()
if (period.get_id() != current_period.get_id()) {
class RGWRESTMgr_Period : public RGWRESTMgr {
public:
- RGWHandler_REST* get_handler(rgw::sal::RGWRadosStore *store,
+ RGWHandler_REST* get_handler(rgw::sal::Store* store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
// read realm
realm.reset(new RGWRealm(id, name));
- op_ret = realm->init(this, g_ceph_context, store->svc()->sysobj, y);
+ op_ret = realm->init(this, g_ceph_context, static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj, y);
if (op_ret < 0)
ldpp_dout(this, -1) << "failed to read realm id=" << id
<< " name=" << name << dendl;
{
{
// read default realm
- RGWRealm realm(store->ctx(), store->svc()->sysobj);
+ RGWRealm realm(store->ctx(), static_cast<rgw::sal::RadosStore*>(store)->svc()->sysobj);
[[maybe_unused]] int ret = realm.read_default_id(this, default_id, y);
}
- op_ret = store->svc()->zone->list_realms(this, realms);
+ op_ret = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->list_realms(this, realms);
if (op_ret < 0)
ldpp_dout(this, -1) << "failed to list realms" << dendl;
}
}
RGWHandler_REST*
-RGWRESTMgr_Realm::get_handler(rgw::sal::RGWRadosStore *store,
+RGWRESTMgr_Realm::get_handler(rgw::sal::Store* store,
struct req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&)