+void cls_rgw_reshard_entry::generate_key(const string& tenant, const string& bucket_name, string *key)
+{
+ *key = tenant + ":" + bucket_name;
+}
+
+void cls_rgw_reshard_entry::get_key(string *key) const
+{
+ generate_key(tenant, bucket_name, key);
+}
+
+void cls_rgw_reshard_entry::dump(Formatter *f) const
+{
+ utime_t ut(time);
+ encode_json("time",ut, f);
+ encode_json("tenant", tenant, f);
+ encode_json("bucket_name", bucket_name, f);
+ encode_json("bucket_id", bucket_id, f);
+ encode_json("new_instance_id", new_instance_id, f);
+ encode_json("old_num_shards", old_num_shards, f);
+ encode_json("new_num_shards", new_num_shards, f);
+
+}
+
+void cls_rgw_reshard_entry::generate_test_instances(list<cls_rgw_reshard_entry*>& ls)
+{
+ ls.push_back(new cls_rgw_reshard_entry);
+ ls.push_back(new cls_rgw_reshard_entry);
+ ls.back()->time = ceph::real_clock::from_ceph_timespec({2, 3});
+ ls.back()->tenant = "tenant";
+ ls.back()->bucket_name = "bucket1""";
+ ls.back()->bucket_id = "bucket_id";
+ ls.back()->new_instance_id = "new_instance_id";
+ ls.back()->old_num_shards = 8;
+ ls.back()->new_num_shards = 64;
+}
+
+void cls_rgw_bucket_instance_entry::dump(Formatter *f) const
+{
+ encode_json("reshard_status", (int)reshard_status, f);
+ encode_json("new_bucket_instance_id", new_bucket_instance_id, f);
+ encode_json("num_shards", num_shards, f);
+
+}
+
+void cls_rgw_bucket_instance_entry::generate_test_instances(list<cls_rgw_bucket_instance_entry*>& ls)
+{
+ ls.push_back(new cls_rgw_bucket_instance_entry);
+ ls.push_back(new cls_rgw_bucket_instance_entry);
+ ls.back()->reshard_status = CLS_RGW_RESHARD_IN_PROGRESS;
+ ls.back()->new_bucket_instance_id = "new_instance_id";
+}