From fc483c82a893f8758a611fa9408677d31afd04f3 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 19 Oct 2015 13:53:16 -0400 Subject: [PATCH] rgw: period allows setting id, epoch, latest_epoch Signed-off-by: Casey Bodley --- src/rgw/rgw_rados.cc | 5 ++--- src/rgw/rgw_rados.h | 9 ++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index d7e8092b87e74..30afd2d66c93e 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -871,7 +871,7 @@ int RGWPeriod::use_latest_epoch() return 0; } -int RGWPeriod::set_latest_epoch(const epoch_t& epoch) +int RGWPeriod::set_latest_epoch(epoch_t epoch) { string pool_name = get_pool_name(cct); string oid = get_period_oid_prefix() + get_latest_epoch_oid(); @@ -889,9 +889,8 @@ int RGWPeriod::set_latest_epoch(const epoch_t& epoch) return ret; return 0; - - } + int RGWPeriod::delete_obj() { string pool_name = get_pool_name(cct); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index befdb2aabe524..3903e505aa406 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1343,7 +1343,6 @@ class RGWPeriod int read_info(); int read_latest_epoch(RGWPeriodLatestEpochInfo& epoch_info); int use_latest_epoch(); - int set_latest_epoch(const epoch_t& epoch); int use_current_period(); const string get_period_oid(); @@ -1368,6 +1367,12 @@ public: const string& get_latest_epoch_oid(); const string& get_info_oid_prefix(); + void set_id(const string& id) { + this->id = id; + period_map.id = id; + } + void set_epoch(epoch_t epoch) { this->epoch = epoch; } + void set_predecessor(const string& predecessor) { predecessor_uuid = predecessor; @@ -1389,6 +1394,8 @@ public: bool is_single_zonegroup(CephContext *cct, RGWRados *store); int get_latest_epoch(epoch_t& epoch); + int set_latest_epoch(epoch_t epoch); + int init(CephContext *_cct, RGWRados *_store, const string &period_realm_id, const string &period_realm_name = "", bool setup_obj = true); int init(CephContext *_cct, RGWRados *_store, bool setup_obj = true); -- 2.39.5