]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Add resharding flag and the new bucket instance id to RGWBucketInfo
authorOrit Wasserman <owasserm@redhat.com>
Thu, 6 Apr 2017 19:48:28 +0000 (22:48 +0300)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 2 Jun 2017 21:46:43 +0000 (14:46 -0700)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_common.h
src/rgw/rgw_json_enc.cc

index 0a7cc342c09815c1de9bc8f8a36115a9ffb45137..f8d1c01183a9fd4894c3d77b966f5d6f78155cc5 100644 (file)
@@ -1177,9 +1177,12 @@ struct RGWBucketInfo
 
   map<string, uint32_t> mdsearch_config;
 
+  /* resharding */
+  bool resharding;
+  string new_bucket_instance_id;
 
   void encode(bufferlist& bl) const {
-     ENCODE_START(18, 4, bl);
+     ENCODE_START(19, 4, bl);
      ::encode(bucket, bl);
      ::encode(owner.id, bl);
      ::encode(flags, bl);
@@ -1204,10 +1207,12 @@ struct RGWBucketInfo
      }
      ::encode(creation_time, bl);
      ::encode(mdsearch_config, bl);
+     ::encode(resharding, bl);
+     ::encode(new_bucket_instance_id, bl);
      ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
-    DECODE_START_LEGACY_COMPAT_LEN_32(18, 4, 4, bl);
+    DECODE_START_LEGACY_COMPAT_LEN_32(19, 4, 4, bl);
      ::decode(bucket, bl);
      if (struct_v >= 2) {
        string s;
@@ -1267,6 +1272,10 @@ struct RGWBucketInfo
      if (struct_v >= 18) {
        ::decode(mdsearch_config, bl);
      }
+     if (struct_v >= 19) {
+       ::decode(resharding, bl);
+       ::decode(new_bucket_instance_id, bl);
+     }
      DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -1284,7 +1293,7 @@ struct RGWBucketInfo
   }
 
   RGWBucketInfo() : flags(0), has_instance_obj(false), num_shards(0), bucket_index_shard_hash_type(MOD), requester_pays(false),
-                    has_website(false), swift_versioning(false) {}
+                    has_website(false), swift_versioning(false),resharding(false) {}
 };
 WRITE_CLASS_ENCODER(RGWBucketInfo)
 
index f5f3612239eb2d6e7da141aa2920a8880d7cc451..a77024e23fdb0c6c793b386d1157fd2445fcebf7 100644 (file)
@@ -738,6 +738,8 @@ void RGWBucketInfo::dump(Formatter *f) const
   encode_json("swift_ver_location", swift_ver_location, f);
   encode_json("index_type", (uint32_t)index_type, f);
   encode_json("mdsearch_config", mdsearch_config, f);
+  encode_json("resharding", resharding, f);
+  encode_json("new_bucket_instance_id", new_bucket_instance_id, f);
 }
 
 void RGWBucketInfo::decode_json(JSONObj *obj) {
@@ -770,6 +772,8 @@ void RGWBucketInfo::decode_json(JSONObj *obj) {
   JSONDecoder::decode_json("index_type", it, obj);
   index_type = (RGWBucketIndexType)it;
   JSONDecoder::decode_json("mdsearch_config", mdsearch_config, obj);
+  JSONDecoder::decode_json("resharding", resharding, obj);
+  JSONDecoder::decode_json("new_bucket_instance_id",new_bucket_instance_id, obj);
 }
 
 void rgw_obj_key::dump(Formatter *f) const