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;
43 rgw_meta_sync_info() : state((int)StateInit), num_shards(0) {}
45 WRITE_CLASS_ENCODER(rgw_meta_sync_info)
47 struct rgw_meta_sync_marker {
54 string next_step_marker;
55 uint64_t total_entries;
58 epoch_t realm_epoch{0}; //< realm_epoch of period marker
60 rgw_meta_sync_marker() : state(FullSync), total_entries(0), pos(0) {}
62 void encode(bufferlist& bl) const {
63 ENCODE_START(2, 1, bl);
66 ::encode(next_step_marker, bl);
67 ::encode(total_entries, bl);
69 ::encode(timestamp, bl);
70 ::encode(realm_epoch, bl);
74 void decode(bufferlist::iterator& bl) {
78 ::decode(next_step_marker, bl);
79 ::decode(total_entries, bl);
81 ::decode(timestamp, bl);
83 ::decode(realm_epoch, bl);
88 void decode_json(JSONObj *obj);
89 void dump(Formatter *f) const;
91 WRITE_CLASS_ENCODER(rgw_meta_sync_marker)
93 struct rgw_meta_sync_status {
94 rgw_meta_sync_info sync_info;
95 map<uint32_t, rgw_meta_sync_marker> sync_markers;
97 rgw_meta_sync_status() {}
99 void encode(bufferlist& bl) const {
100 ENCODE_START(1, 1, bl);
101 ::encode(sync_info, bl);
102 ::encode(sync_markers, bl);
106 void decode(bufferlist::iterator& bl) {
108 ::decode(sync_info, bl);
109 ::decode(sync_markers, bl);
113 void dump(Formatter *f) const;
114 void decode_json(JSONObj *obj);
116 WRITE_CLASS_ENCODER(rgw_meta_sync_status)