DECODE_FINISH(bl);
}
- void dump(Formatter *f) const {
- encode_json("position", position, f);
- encode_json("count", count, f);
- }
+ void dump(Formatter *f) const;
+ void decode_json(JSONObj *obj);
};
WRITE_CLASS_ENCODER(rgw_bucket_shard_full_sync_marker)
DECODE_FINISH(bl);
}
- void dump(Formatter *f) const {
- encode_json("position", position, f);
- }
+ void dump(Formatter *f) const;
+ void decode_json(JSONObj *obj);
bool operator<(const rgw_bucket_shard_inc_sync_marker& m) const {
return (position < m.position);
DECODE_FINISH(bl);
}
- void dump(Formatter *f) const {
- string s;
- switch ((SyncState)state) {
- case StateInit:
- s = "init";
- break;
- case StateFullSync:
- s = "full-sync";
- break;
- case StateIncrementalSync:
- s = "incremental-sync";
- break;
- default:
- s = "unknown";
- break;
- }
- encode_json("status", s, f);
- encode_json("full_marker", full_marker, f);
- encode_json("inc_marker", inc_marker, f);
- }
+ void dump(Formatter *f) const;
+ void decode_json(JSONObj *obj);
rgw_bucket_shard_sync_info() : state((int)StateInit) {}
#include "rgw_keystone.h"
#include "rgw_basic_types.h"
#include "rgw_op.h"
+#include "rgw_data_sync.h"
#include "rgw_sync.h"
#include "rgw_orphan.h"
encode_json("ns", ns, f);
}
+void rgw_obj_key::decode_json(JSONObj *obj)
+{
+ JSONDecoder::decode_json("name", name, obj);
+ JSONDecoder::decode_json("instance", instance, obj);
+ JSONDecoder::decode_json("ns", ns, obj);
+}
+
void RGWBucketEnt::dump(Formatter *f) const
{
encode_json("bucket", bucket, f);
encode_json("message", message, f);
}
+void rgw_bucket_shard_full_sync_marker::decode_json(JSONObj *obj)
+{
+ JSONDecoder::decode_json("position", position, obj);
+ JSONDecoder::decode_json("count", count, obj);
+}
+
+void rgw_bucket_shard_full_sync_marker::dump(Formatter *f) const
+{
+ encode_json("position", position, f);
+ encode_json("count", count, f);
+}
+
+void rgw_bucket_shard_inc_sync_marker::decode_json(JSONObj *obj)
+{
+ JSONDecoder::decode_json("position", position, obj);
+}
+
+void rgw_bucket_shard_inc_sync_marker::dump(Formatter *f) const
+{
+ encode_json("position", position, f);
+}
+
+void rgw_bucket_shard_sync_info::decode_json(JSONObj *obj)
+{
+ std::string s;
+ JSONDecoder::decode_json("status", s, obj);
+ if (s == "full-sync") {
+ state = StateFullSync;
+ } else if (s == "incremental-sync") {
+ state = StateIncrementalSync;
+ } else {
+ state = StateInit;
+ }
+ JSONDecoder::decode_json("full_marker", full_marker, obj);
+ JSONDecoder::decode_json("inc_marker", inc_marker, obj);
+}
+
+void rgw_bucket_shard_sync_info::dump(Formatter *f) const
+{
+ const char *s{nullptr};
+ switch ((SyncState)state) {
+ case StateInit:
+ s = "init";
+ break;
+ case StateFullSync:
+ s = "full-sync";
+ break;
+ case StateIncrementalSync:
+ s = "incremental-sync";
+ break;
+ default:
+ s = "unknown";
+ break;
+ }
+ encode_json("status", s, f);
+ encode_json("full_marker", full_marker, f);
+ encode_json("inc_marker", inc_marker, f);
+}
+
/* This utility function shouldn't conflict with the overload of std::to_string
* provided by string_ref since Boost 1.54 as it's defined outside of the std
* namespace. I hope we'll remove it soon - just after merging the Matt's PR