]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: implement rgw_bucket_olh_log_entry::dump()
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 9 Sep 2014 20:31:42 +0000 (13:31 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 16 Jan 2015 22:33:49 +0000 (14:33 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/rgw/cls_rgw_types.cc
src/cls/rgw/cls_rgw_types.h

index 65ccbfde7b5ab5ed87e7c4c31d7bf2d989e1ecc1..b15b9637568f37688361caed34543d3b242b0c76 100644 (file)
@@ -1,6 +1,7 @@
 
 #include "cls/rgw/cls_rgw_types.h"
 #include "common/Formatter.h"
+#include "common/ceph_json.h"
 
 
 void rgw_bucket_pending_info::generate_test_instances(list<rgw_bucket_pending_info*>& o)
@@ -108,6 +109,26 @@ void rgw_bucket_dir_entry::dump(Formatter *f) const
   f->close_section();
 }
 
+void rgw_bucket_olh_log_entry::dump(Formatter *f) const
+{
+  encode_json("epoch", epoch, f);
+  const char *op_str;
+  switch (op) {
+    case CLS_RGW_OLH_OP_LINK_OLH:
+      op_str = "link_olh";
+      break;
+    case CLS_RGW_OLH_OP_REMOVE_INSTANCE:
+      op_str = "remove_instance";
+      break;
+    default:
+      op_str = "unknown";
+  }
+  encode_json("op", op_str, f);
+  encode_json("op_tag", op_tag, f);
+  encode_json("key", key, f);
+  encode_json("delete_marker", delete_marker, f);
+}
+
 void rgw_bi_log_entry::dump(Formatter *f) const
 {
   f->dump_string("op_id", id);
index d4e6cbfe0efc151693752e84c0251f05a6c17dd9..ec025a521f16b02d0c0d1e2e8657dffc1908e053 100644 (file)
@@ -344,6 +344,7 @@ struct rgw_bucket_olh_log_entry {
     ::decode(delete_marker, bl);
     DECODE_FINISH(bl);
   }
+  void dump(Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_bucket_olh_log_entry)