]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: period allows setting id, epoch, latest_epoch
authorCasey Bodley <cbodley@redhat.com>
Mon, 19 Oct 2015 17:53:16 +0000 (13:53 -0400)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:20 +0000 (16:13 -0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index d7e8092b87e74fa81536ba90c47470032c26b359..30afd2d66c93ec81c2fb3ead76c943a067fbbf33 100644 (file)
@@ -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);
index befdb2aabe5249a5fdb759efb0f57c113493acce..3903e505aa406fb8b4c0c408517363488d4755c6 100644 (file)
@@ -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);