From: Seena Fallah Date: Sat, 7 Jun 2025 20:06:01 +0000 (+0200) Subject: rgw/sal: introduce DataProcessorFactory X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=95d3bc70d1dc31f7092607b3083e443e1084613c;p=ceph.git rgw/sal: introduce DataProcessorFactory This is a factory for DataProcessor to enable reading the data by RGWGetObj_Filter and pass it to be processed by the writer that is defined by set_writer(). With that, we can have filters applied to the data before writing. That can be either filter on read or filter on write. Co-authored-by: Marcus Watts Signed-off-by: Seena Fallah --- diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 2d820af5dea..60688a66bc1 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -51,6 +51,7 @@ class RGWZonePlacementInfo; struct rgw_pubsub_topic; struct RGWOIDCProviderInfo; struct RGWRoleInfo; +class RGWGetObj_Filter; using RGWBucketListNameFilter = std::function; @@ -264,6 +265,29 @@ struct TopicList { std::string next_marker; }; +/** + * @brief A factory for DataProcessor instances + * + * This factory is used to create DataProcessor instances that can process data + * in a streaming fashion. It is used by the RGWGetDataCB interface to allow + * data to be processed as it is read from the backing store. + * The factory is responsible for passing the read data to the DataProcessor + * passed through the set_writer() method. + */ +class DataProcessorFactory { + public: + DataProcessorFactory() {} + virtual ~DataProcessorFactory() {} + + virtual int set_writer(DataProcessor* writer, + Attrs& attrs, + const DoutPrefixProvider *dpp, + optional_yield y) = 0; + virtual RGWGetObj_Filter* get_filter() = 0; + virtual bool need_copy_data() = 0; + virtual void finalize_attrs(Attrs& attrs) { /* default implementation does nothing */ } +}; + /** * @brief Base singleton representing a Store or Filter *