}
}
+
+// advance to the next stripe
+int ManifestObjectProcessor::next(uint64_t offset, uint64_t *pstripe_size)
+{
+ // advance the manifest
+ int r = manifest_gen.create_next(offset);
+ if (r < 0) {
+ return r;
+ }
+
+ rgw_raw_obj stripe_obj = manifest_gen.get_cur_obj(store);
+
+ uint64_t chunk_size = 0;
+ r = store->get_max_chunk_size(stripe_obj.pool, &chunk_size);
+ if (r < 0) {
+ return r;
+ }
+ r = writer.set_stripe_obj(std::move(stripe_obj));
+ if (r < 0) {
+ return r;
+ }
+
+ chunk = ChunkProcessor(&writer, chunk_size);
+ *pstripe_size = manifest_gen.cur_stripe_max_size();
+ return 0;
+}
+
} // namespace rgw::putobj
void clear_written() { written.clear(); }
};
+// a rados object processor that stripes according to RGWObjManifest
+class ManifestObjectProcessor : public HeadObjectProcessor,
+ public StripeGenerator {
+ protected:
+ RGWRados *const store;
+ const RGWBucketInfo& bucket_info;
+ const rgw_user& owner;
+ RGWObjectCtx& obj_ctx;
+ rgw_obj head_obj;
+
+ RadosWriter writer;
+ RGWObjManifest manifest;
+ RGWObjManifest::generator manifest_gen;
+ ChunkProcessor chunk;
+ StripeProcessor stripe;
+
+ // implements StripeGenerator
+ int next(uint64_t offset, uint64_t *stripe_size) override;
+
+ public:
+ ManifestObjectProcessor(Aio *aio, RGWRados *store,
+ const RGWBucketInfo& bucket_info,
+ const rgw_user& owner, RGWObjectCtx& obj_ctx,
+ const rgw_obj& head_obj)
+ : HeadObjectProcessor(0),
+ store(store), bucket_info(bucket_info), owner(owner),
+ obj_ctx(obj_ctx), head_obj(head_obj),
+ writer(aio, store, bucket_info, obj_ctx, head_obj),
+ chunk(&writer, 0), stripe(&chunk, this, 0)
+ {}
+};
+
} // namespace rgw::putobj