Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / cls / log / cls_log_types.h
1 #ifndef CEPH_CLS_LOG_TYPES_H
2 #define CEPH_CLS_LOG_TYPES_H
3
4 #include "include/encoding.h"
5 #include "include/types.h"
6
7 #include "include/utime.h"
8
9 class JSONObj;
10
11
12 struct cls_log_entry {
13   string id;
14   string section;
15   string name;
16   utime_t timestamp;
17   bufferlist data;
18
19   cls_log_entry() {}
20
21   void encode(bufferlist& bl) const {
22     ENCODE_START(2, 1, bl);
23     ::encode(section, bl);
24     ::encode(name, bl);
25     ::encode(timestamp, bl);
26     ::encode(data, bl);
27     ::encode(id, bl);
28     ENCODE_FINISH(bl);
29   }
30
31   void decode(bufferlist::iterator& bl) {
32     DECODE_START(2, bl);
33     ::decode(section, bl);
34     ::decode(name, bl);
35     ::decode(timestamp, bl);
36     ::decode(data, bl);
37     if (struct_v >= 2)
38       ::decode(id, bl);
39     DECODE_FINISH(bl);
40   }
41 };
42 WRITE_CLASS_ENCODER(cls_log_entry)
43
44 struct cls_log_header {
45   string max_marker;
46   utime_t max_time;
47
48   void encode(bufferlist& bl) const {
49     ENCODE_START(1, 1, bl);
50     ::encode(max_marker, bl);
51     ::encode(max_time, bl);
52     ENCODE_FINISH(bl);
53   }
54
55   void decode(bufferlist::iterator& bl) {
56     DECODE_START(1, bl);
57     ::decode(max_marker, bl);
58     ::decode(max_time, bl);
59     DECODE_FINISH(bl);
60   }
61 };
62 WRITE_CLASS_ENCODER(cls_log_header)
63
64
65 #endif
66
67