]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_putobj.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / rgw / rgw_putobj.h
index e3d9271548301034fad75b8930a5c02583aa7804..1c16b22540a36c57c8e0c47116bea866f4873827 100644 (file)
 #pragma once
 
 #include "include/buffer.h"
+#include "rgw_sal.h"
 
 namespace rgw::putobj {
 
-// a simple streaming data processing abstraction
-class DataProcessor {
- public:
-  virtual ~DataProcessor() {}
-
-  // consume a bufferlist in its entirety at the given object offset. an
-  // empty bufferlist is given to request that any buffered data be flushed,
-  // though this doesn't wait for completions
-  virtual int process(bufferlist&& data, uint64_t offset) = 0;
-};
-
 // for composing data processors into a pipeline
-class Pipe : public DataProcessor {
-  DataProcessor *next;
+class Pipe : public rgw::sal::DataProcessor {
+  rgw::sal::DataProcessor *next;
  public:
-  explicit Pipe(DataProcessor *next) : next(next) {}
+  explicit Pipe(rgw::sal::DataProcessor *next) : next(next) {}
 
   // passes the data on to the next processor
   int process(bufferlist&& data, uint64_t offset) override {
@@ -47,7 +37,7 @@ class ChunkProcessor : public Pipe {
   uint64_t chunk_size;
   bufferlist chunk; // leftover bytes from the last call to process()
  public:
-  ChunkProcessor(DataProcessor *next, uint64_t chunk_size)
+  ChunkProcessor(rgw::sal::DataProcessor *next, uint64_t chunk_size)
     : Pipe(next), chunk_size(chunk_size)
   {}
 
@@ -68,7 +58,7 @@ class StripeProcessor : public Pipe {
   StripeGenerator *gen;
   std::pair<uint64_t, uint64_t> bounds; // bounds of current stripe
  public:
-  StripeProcessor(DataProcessor *next, StripeGenerator *gen,
+  StripeProcessor(rgw::sal::DataProcessor *next, StripeGenerator *gen,
                   uint64_t first_stripe_size)
     : Pipe(next), gen(gen), bounds(0, first_stripe_size)
   {}