summaryrefslogtreecommitdiffstats
path: root/src/cls/timeindex
diff options
context:
space:
mode:
authorAbhishek Lekshmanan <abhishek@suse.com>2019-07-22 16:40:23 +0200
committerAbhishek Lekshmanan <abhishek@suse.com>2019-07-22 17:41:11 +0200
commit8c7e84f053e9da3a775c05c3c0c5b0431c4219ee (patch)
tree6cc1c03fc07923107e9e78c6744da7100d7762e0 /src/cls/timeindex
parentMerge pull request #28764 from rhcs-dashboard/rgw-bucket-placement-target (diff)
downloadceph-8c7e84f053e9da3a775c05c3c0c5b0431c4219ee.tar.xz
ceph-8c7e84f053e9da3a775c05c3c0c5b0431c4219ee.zip
cls: add timeindex types to ceph-dencoder
This is useful for seeing on disk format of types using cls_timeindex like rgw swift with delete at attributes Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
Diffstat (limited to 'src/cls/timeindex')
-rw-r--r--src/cls/timeindex/cls_timeindex_types.cc21
-rw-r--r--src/cls/timeindex/cls_timeindex_types.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/src/cls/timeindex/cls_timeindex_types.cc b/src/cls/timeindex/cls_timeindex_types.cc
new file mode 100644
index 00000000000..98c3741863f
--- /dev/null
+++ b/src/cls/timeindex/cls_timeindex_types.cc
@@ -0,0 +1,21 @@
+#include "cls_timeindex_types.h"
+#include "common/Formatter.h"
+
+void cls_timeindex_entry::dump(Formatter *f) const
+{
+ f->dump_stream("key_ts") << key_ts;
+ f->dump_string("key_ext", key_ext);
+ f->dump_string("value", value.to_str());
+}
+
+void cls_timeindex_entry::generate_test_instances(list<cls_timeindex_entry*>& o)
+{
+ cls_timeindex_entry *i = new cls_timeindex_entry;
+ i->key_ts = utime_t(0,0);
+ i->key_ext = "foo";
+ bufferlist bl;
+ bl.append("bar");
+ i->value = bl;
+ o.push_back(i);
+ o.push_back(new cls_timeindex_entry);
+}
diff --git a/src/cls/timeindex/cls_timeindex_types.h b/src/cls/timeindex/cls_timeindex_types.h
index 2b381767cf6..90ac3b8e55d 100644
--- a/src/cls/timeindex/cls_timeindex_types.h
+++ b/src/cls/timeindex/cls_timeindex_types.h
@@ -37,6 +37,9 @@ struct cls_timeindex_entry {
decode(value, bl);
DECODE_FINISH(bl);
}
+
+ void dump(Formatter *f) const;
+ static void generate_test_instances(list<cls_timeindex_entry*>& o);
};
WRITE_CLASS_ENCODER(cls_timeindex_entry)