#include "common/bounded_key_counter.h"
#include "common/errno.h"
+#include "rgw_sync_log_trim.h"
#include "rgw_cr_rados.h"
#include "rgw_metadata.h"
#include "rgw_rados.h"
-#include "rgw_sync_log_trim.h"
#include "rgw_sync.h"
#include <boost/asio/yield.hpp>
using rgw::BucketTrimConfig;
using BucketChangeCounter = BoundedKeyCounter<std::string, int>;
+const std::string rgw::BucketTrimStatus::oid = "bilog.trim";
+using rgw::BucketTrimStatus;
+
// watch/notify api for gateways to coordinate about which buckets to trim
enum TrimNotifyType {
Impl(RGWRados *store, const BucketTrimConfig& config)
: store(store), config(config),
- status_obj(store->get_zone_params().log_pool, "bilog.trim"),
+ status_obj(store->get_zone_params().log_pool, BucketTrimStatus::oid),
counter(config.counter_size),
watcher(store, status_obj, this)
{}
#include <memory>
#include <boost/utility/string_view.hpp>
+#include "include/encoding.h"
class CephContext;
class RGWCoroutine;
RGWCoroutine* create_bucket_trim_cr();
};
+/// provides persistent storage for the trim manager's current position in the
+/// list of bucket instance metadata
+struct BucketTrimStatus {
+ std::string marker; //< metadata key of current bucket instance
+
+ void encode(bufferlist& bl) const {
+ ENCODE_START(1, 1, bl);
+ ::encode(marker, bl);
+ ENCODE_FINISH(bl);
+ }
+ void decode(bufferlist::iterator& p) {
+ DECODE_START(1, p);
+ ::decode(marker, p);
+ DECODE_FINISH(p);
+ }
+
+ static const std::string oid;
+};
+
} // namespace rgw
+WRITE_CLASS_ENCODER(rgw::BucketTrimStatus);
+
#endif // RGW_SYNC_LOG_TRIM_H