Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / cls / statelog / cls_statelog_types.h
1 #ifndef CEPH_CLS_STATELOG_TYPES_H
2 #define CEPH_CLS_STATELOG_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 struct cls_statelog_entry {
12   string client_id;
13   string op_id;
14   string object;
15   utime_t timestamp;
16   bufferlist data;
17   uint32_t state; /* user defined state */
18
19   cls_statelog_entry() : state(0) {}
20
21   void encode(bufferlist& bl) const {
22     ENCODE_START(1, 1, bl);
23     ::encode(client_id, bl);
24     ::encode(op_id, bl);
25     ::encode(object, bl);
26     ::encode(timestamp, bl);
27     ::encode(data, bl);
28     ::encode(state, bl);
29     ENCODE_FINISH(bl);
30   }
31
32   void decode(bufferlist::iterator& bl) {
33     DECODE_START(1, bl);
34     ::decode(client_id, bl);
35     ::decode(op_id, bl);
36     ::decode(object, bl);
37     ::decode(timestamp, bl);
38     ::decode(data, bl);
39     ::decode(state, bl);
40     DECODE_FINISH(bl);
41   }
42
43   void dump(Formatter *f) const;
44   void decode_json(JSONObj *obj);
45 };
46 WRITE_CLASS_ENCODER(cls_statelog_entry)
47
48
49 #endif
50
51