Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / cls / timeindex / cls_timeindex_types.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_CLS_TIMEINDEX_TYPES_H
5 #define CEPH_CLS_TIMEINDEX_TYPES_H
6
7 #include "include/encoding.h"
8 #include "include/types.h"
9
10 #include "include/utime.h"
11
12 class JSONObj;
13
14 struct cls_timeindex_entry {
15   /* Mandatory timestamp. Will be part of the key. */
16   utime_t key_ts;
17   /* Not mandatory. The name_ext field, if not empty, will form second
18    * part of the key. */
19   string key_ext;
20   /* Become value of OMAP-based mapping. */
21   bufferlist value;
22
23   cls_timeindex_entry() {}
24
25   void encode(bufferlist& bl) const {
26     ENCODE_START(1, 1, bl);
27     ::encode(key_ts, bl);
28     ::encode(key_ext, bl);
29     ::encode(value, bl);
30     ENCODE_FINISH(bl);
31   }
32
33   void decode(bufferlist::iterator& bl) {
34     DECODE_START(1, bl);
35     ::decode(key_ts, bl);
36     ::decode(key_ext, bl);
37     ::decode(value, bl);
38     DECODE_FINISH(bl);
39   }
40 };
41 WRITE_CLASS_ENCODER(cls_timeindex_entry)
42
43 #endif /* CEPH_CLS_TIMEINDEX_TYPES_H */