]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sal: introduce DataProcessorFactory
authorSeena Fallah <seenafallah@gmail.com>
Sat, 7 Jun 2025 20:06:01 +0000 (22:06 +0200)
committerSeena Fallah <seenafallah@gmail.com>
Wed, 19 Nov 2025 17:37:48 +0000 (18:37 +0100)
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 <mwatts@redhat.com>
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
src/rgw/rgw_sal.h

index 2d820af5dea8a48c4dd210fceb6037de7f207602..60688a66bc155051842a1b248816fc9d755d6750 100644 (file)
@@ -51,6 +51,7 @@ class RGWZonePlacementInfo;
 struct rgw_pubsub_topic;
 struct RGWOIDCProviderInfo;
 struct RGWRoleInfo;
+class RGWGetObj_Filter;
 
 using RGWBucketListNameFilter = std::function<bool (const std::string&)>;
 
@@ -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
  *