1 #ifndef RGW_META_SYNC_STATUS_H
2 #define RGW_META_SYNC_STATUS_H
6 #include "common/ceph_time.h"
8 struct rgw_meta_sync_info
{
11 StateBuildingFullSyncMaps
= 1,
17 std::string period
; //< period id of current metadata log
18 epoch_t realm_epoch
= 0; //< realm epoch of period
20 void encode(bufferlist
& bl
) const {
21 ENCODE_START(2, 1, bl
);
23 ::encode(num_shards
, bl
);
25 ::encode(realm_epoch
, bl
);
29 void decode(bufferlist::iterator
& bl
) {
32 ::decode(num_shards
, bl
);
35 ::decode(realm_epoch
, bl
);
40 void decode_json(JSONObj
*obj
);
41 void dump(Formatter
*f
) const;
42 static void generate_test_instances(std::list
<rgw_meta_sync_info
*>& ls
);
44 rgw_meta_sync_info() : state((int)StateInit
), num_shards(0) {}
46 WRITE_CLASS_ENCODER(rgw_meta_sync_info
)
48 struct rgw_meta_sync_marker
{
55 string next_step_marker
;
56 uint64_t total_entries
;
59 epoch_t realm_epoch
{0}; //< realm_epoch of period marker
61 rgw_meta_sync_marker() : state(FullSync
), total_entries(0), pos(0) {}
63 void encode(bufferlist
& bl
) const {
64 ENCODE_START(2, 1, bl
);
67 ::encode(next_step_marker
, bl
);
68 ::encode(total_entries
, bl
);
70 ::encode(timestamp
, bl
);
71 ::encode(realm_epoch
, bl
);
75 void decode(bufferlist::iterator
& bl
) {
79 ::decode(next_step_marker
, bl
);
80 ::decode(total_entries
, bl
);
82 ::decode(timestamp
, bl
);
84 ::decode(realm_epoch
, bl
);
89 void decode_json(JSONObj
*obj
);
90 void dump(Formatter
*f
) const;
91 static void generate_test_instances(std::list
<rgw_meta_sync_marker
*>& ls
);
93 WRITE_CLASS_ENCODER(rgw_meta_sync_marker
)
95 struct rgw_meta_sync_status
{
96 rgw_meta_sync_info sync_info
;
97 map
<uint32_t, rgw_meta_sync_marker
> sync_markers
;
99 rgw_meta_sync_status() {}
101 void encode(bufferlist
& bl
) const {
102 ENCODE_START(1, 1, bl
);
103 ::encode(sync_info
, bl
);
104 ::encode(sync_markers
, bl
);
108 void decode(bufferlist::iterator
& bl
) {
110 ::decode(sync_info
, bl
);
111 ::decode(sync_markers
, bl
);
115 void dump(Formatter
*f
) const;
116 void decode_json(JSONObj
*obj
);
117 static void generate_test_instances(std::list
<rgw_meta_sync_status
*>& ls
);
119 WRITE_CLASS_ENCODER(rgw_meta_sync_status
)