#include "common/ceph_json.h"
#include "include/utime.h"
+using std::list;
+using std::map;
+
+using ceph::Formatter;
+
void rgw_cls_tag_timeout_op::dump(Formatter *f) const
{
f->dump_int("tag_timeout", tag_timeout);
ls.back()->truncated = true;
}
-
void cls_rgw_gc_remove_op::dump(Formatter *f) const
{
encode_json("tags", tags, f);
ls.back()->tags.push_back("tag2");
}
+void cls_rgw_lc_get_entry_ret::dump(Formatter *f) const
+{
+ encode_json("entry", entry, f);
+}
+
+void cls_rgw_lc_get_entry_ret::generate_test_instances(list<cls_rgw_lc_get_entry_ret*>& ls)
+{
+ cls_rgw_lc_entry entry("bucket1", 6000, 0);
+ ls.push_back(new cls_rgw_lc_get_entry_ret);
+ ls.back()->entry = entry;
+}
+
void rgw_cls_obj_prepare_op::generate_test_instances(list<rgw_cls_obj_prepare_op*>& o)
{
rgw_cls_obj_prepare_op *op = new rgw_cls_obj_prepare_op;
f->dump_string("locator", locator);
f->dump_bool("log_op", log_op);
f->dump_int("bilog_flags", bilog_flags);
- ::encode_json("zones_trace", zones_trace, f);
+ encode_json("zones_trace", zones_trace, f);
}
void rgw_cls_obj_complete_op::generate_test_instances(list<rgw_cls_obj_complete_op*>& o)
list<rgw_bucket_dir_entry_meta *> l;
rgw_bucket_dir_entry_meta::generate_test_instances(l);
- list<rgw_bucket_dir_entry_meta *>::iterator iter = l.begin();
+ auto iter = l.begin();
op->meta = *(*iter);
o.push_back(op);
f->dump_string("tag", tag);
f->dump_bool("log_op", log_op);
f->dump_int("bilog_flags", bilog_flags);
- ::encode_json("zones_trace", zones_trace, f);
+ encode_json("zones_trace", zones_trace, f);
}
void rgw_cls_link_olh_op::generate_test_instances(list<rgw_cls_link_olh_op*>& o)
op->olh_epoch = 123;
list<rgw_bucket_dir_entry_meta *> l;
rgw_bucket_dir_entry_meta::generate_test_instances(l);
- list<rgw_bucket_dir_entry_meta *>::iterator iter = l.begin();
+ auto iter = l.begin();
op->meta = *(*iter);
op->log_op = true;
void rgw_cls_link_olh_op::dump(Formatter *f) const
{
- ::encode_json("key", key, f);
- ::encode_json("olh_tag", olh_tag, f);
- ::encode_json("delete_marker", delete_marker, f);
- ::encode_json("op_tag", op_tag, f);
- ::encode_json("meta", meta, f);
- ::encode_json("olh_epoch", olh_epoch, f);
- ::encode_json("log_op", log_op, f);
- ::encode_json("bilog_flags", (uint32_t)bilog_flags, f);
+ encode_json("key", key, f);
+ encode_json("olh_tag", olh_tag, f);
+ encode_json("delete_marker", delete_marker, f);
+ encode_json("op_tag", op_tag, f);
+ encode_json("meta", meta, f);
+ encode_json("olh_epoch", olh_epoch, f);
+ encode_json("log_op", log_op, f);
+ encode_json("bilog_flags", (uint32_t)bilog_flags, f);
utime_t ut(unmod_since);
- ::encode_json("unmod_since", ut, f);
- ::encode_json("high_precision_time", high_precision_time, f);
- ::encode_json("zones_trace", zones_trace, f);
+ encode_json("unmod_since", ut, f);
+ encode_json("high_precision_time", high_precision_time, f);
+ encode_json("zones_trace", zones_trace, f);
}
void rgw_cls_unlink_instance_op::generate_test_instances(list<rgw_cls_unlink_instance_op*>& o)
void rgw_cls_unlink_instance_op::dump(Formatter *f) const
{
- ::encode_json("key", key, f);
- ::encode_json("op_tag", op_tag, f);
- ::encode_json("olh_epoch", olh_epoch, f);
- ::encode_json("log_op", log_op, f);
- ::encode_json("bilog_flags", (uint32_t)bilog_flags, f);
- ::encode_json("zones_trace", zones_trace, f);
+ encode_json("key", key, f);
+ encode_json("op_tag", op_tag, f);
+ encode_json("olh_epoch", olh_epoch, f);
+ encode_json("log_op", log_op, f);
+ encode_json("bilog_flags", (uint32_t)bilog_flags, f);
+ encode_json("zones_trace", zones_trace, f);
}
void rgw_cls_read_olh_log_op::generate_test_instances(list<rgw_cls_read_olh_log_op*>& o)
void rgw_cls_read_olh_log_op::dump(Formatter *f) const
{
- ::encode_json("olh", olh, f);
- ::encode_json("ver_marker", ver_marker, f);
- ::encode_json("olh_tag", olh_tag, f);
+ encode_json("olh", olh, f);
+ encode_json("ver_marker", ver_marker, f);
+ encode_json("olh_tag", olh_tag, f);
}
void rgw_cls_read_olh_log_ret::generate_test_instances(list<rgw_cls_read_olh_log_ret*>& o)
r->is_truncated = true;
list<rgw_bucket_olh_log_entry *> l;
rgw_bucket_olh_log_entry::generate_test_instances(l);
- list<rgw_bucket_olh_log_entry *>::iterator iter = l.begin();
+ auto iter = l.begin();
r->log[1].push_back(*(*iter));
o.push_back(r);
void rgw_cls_read_olh_log_ret::dump(Formatter *f) const
{
- ::encode_json("log", log, f);
- ::encode_json("is_truncated", is_truncated, f);
+ encode_json("log", log, f);
+ encode_json("is_truncated", is_truncated, f);
}
void rgw_cls_trim_olh_log_op::generate_test_instances(list<rgw_cls_trim_olh_log_op*>& o)
void rgw_cls_trim_olh_log_op::dump(Formatter *f) const
{
- ::encode_json("olh", olh, f);
- ::encode_json("ver", ver, f);
- ::encode_json("olh_tag", olh_tag, f);
+ encode_json("olh", olh, f);
+ encode_json("ver", ver, f);
+ encode_json("olh_tag", olh_tag, f);
}
void rgw_cls_bucket_clear_olh_op::generate_test_instances(list<rgw_cls_bucket_clear_olh_op *>& o)
void rgw_cls_bucket_clear_olh_op::dump(Formatter *f) const
{
- ::encode_json("key", key, f);
- ::encode_json("olh_tag", olh_tag, f);
+ encode_json("key", key, f);
+ encode_json("olh_tag", olh_tag, f);
}
void rgw_cls_list_op::generate_test_instances(list<rgw_cls_list_op*>& o)
{
list<rgw_bucket_dir *> l;
rgw_bucket_dir::generate_test_instances(l);
- list<rgw_bucket_dir *>::iterator iter;
- for (iter = l.begin(); iter != l.end(); ++iter) {
+ for (auto iter = l.begin(); iter != l.end(); ++iter) {
rgw_bucket_dir *d = *iter;
rgw_cls_list_ret *ret = new rgw_cls_list_ret;
r->calculated_header = *(h.front());
o.push_back(r);
- for (list<rgw_bucket_dir_header *>::iterator iter = h.begin(); iter != h.end(); ++iter) {
+ for (auto iter = h.begin(); iter != h.end(); ++iter) {
delete *iter;
}
o.push_back(new rgw_cls_check_index_ret);
void rgw_cls_check_index_ret::dump(Formatter *f) const
{
- ::encode_json("existing_header", existing_header, f);
- ::encode_json("calculated_header", calculated_header, f);
+ encode_json("existing_header", existing_header, f);
+ encode_json("calculated_header", calculated_header, f);
}
void rgw_cls_bucket_update_stats_op::generate_test_instances(list<rgw_cls_bucket_update_stats_op*>& o)
void rgw_cls_bucket_update_stats_op::dump(Formatter *f) const
{
- ::encode_json("absolute", absolute, f);
+ encode_json("absolute", absolute, f);
map<int, rgw_bucket_category_stats> s;
for (auto& entry : stats) {
s[(int)entry.first] = entry.second;
}
- ::encode_json("stats", s, f);
+ encode_json("stats", s, f);
}
void cls_rgw_bi_log_list_op::dump(Formatter *f) const
ls.back()->truncated = true;
}
+void cls_rgw_mp_upload_part_info_update_op::generate_test_instances(std::list<cls_rgw_mp_upload_part_info_update_op*>& ls)
+{
+ ls.push_back(new cls_rgw_mp_upload_part_info_update_op);
+ ls.back()->part_key = "part1";
+ ls.push_back(new cls_rgw_mp_upload_part_info_update_op);
+ ls.back()->part_key = "part2";
+}
+
+void cls_rgw_mp_upload_part_info_update_op::dump(Formatter* f) const
+{
+ encode_json("part_key", part_key, f);
+ encode_json("part_num", info.num, f);
+ encode_json("part_prefix", info.manifest.get_prefix(), f);
+}
+
void cls_rgw_reshard_add_op::generate_test_instances(list<cls_rgw_reshard_add_op*>& ls)
{
ls.push_back(new cls_rgw_reshard_add_op);
ls.push_back(new cls_rgw_reshard_add_op);
list<cls_rgw_reshard_entry *> l;
cls_rgw_reshard_entry::generate_test_instances(l);
- list<cls_rgw_reshard_entry *>::iterator iter = l.begin();
+ auto iter = l.begin();
ls.back()->entry = *(*iter);
}
void cls_rgw_reshard_add_op::dump(Formatter *f) const
{
- ::encode_json("entry", entry, f);
+ encode_json("entry", entry, f);
}
void cls_rgw_reshard_list_op::generate_test_instances(list<cls_rgw_reshard_list_op*>& ls)
void cls_rgw_reshard_list_op::dump(Formatter *f) const
{
- ::encode_json("max", max, f);
- ::encode_json("marker", marker, f);
+ encode_json("max", max, f);
+ encode_json("marker", marker, f);
}
void cls_rgw_reshard_list_ret::generate_test_instances(list<cls_rgw_reshard_list_ret*>& ls)
void cls_rgw_reshard_list_ret::dump(Formatter *f) const
{
- ::encode_json("entries", entries, f);
- ::encode_json("is_truncated", is_truncated, f);
+ encode_json("entries", entries, f);
+ encode_json("is_truncated", is_truncated, f);
}
void cls_rgw_reshard_get_op::generate_test_instances(list<cls_rgw_reshard_get_op*>& ls)
void cls_rgw_reshard_get_op::dump(Formatter *f) const
{
- ::encode_json("entry", entry, f);
+ encode_json("entry", entry, f);
}
void cls_rgw_reshard_get_ret::generate_test_instances(list<cls_rgw_reshard_get_ret*>& ls)
void cls_rgw_reshard_get_ret::dump(Formatter *f) const
{
- ::encode_json("entry", entry, f);
+ encode_json("entry", entry, f);
}
void cls_rgw_reshard_remove_op::generate_test_instances(list<cls_rgw_reshard_remove_op*>& ls)
void cls_rgw_reshard_remove_op::dump(Formatter *f) const
{
- ::encode_json("bucket_name", bucket_name, f);
- ::encode_json("bucket_id", bucket_name, f);
+ encode_json("bucket_name", bucket_name, f);
+ encode_json("bucket_id", bucket_name, f);
}
void cls_rgw_set_bucket_resharding_op::dump(Formatter *f) const
{
- ::encode_json("entry", entry, f);
+ encode_json("entry", entry, f);
}
void cls_rgw_clear_bucket_resharding_op::generate_test_instances(
void cls_rgw_guard_bucket_resharding_op::dump(Formatter *f) const
{
- ::encode_json("ret_err", ret_err, f);
+ encode_json("ret_err", ret_err, f);
}
void cls_rgw_get_bucket_resharding_op::dump(Formatter *f) const
{
}
-
-
-
-
-