martinzink commented on a change in pull request #1248:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1248#discussion_r799641338



##########
File path: extensions/standard-processors/processors/DefragmentText.h
##########
@@ -64,32 +65,48 @@ class DefragmentText : public core::Processor {
  protected:
   class Buffer {
    public:
-    bool isCompatible(const core::FlowFile& fragment) const;
     void append(core::ProcessSession* session, const 
gsl::not_null<std::shared_ptr<core::FlowFile>>& flow_file_to_append);
-    bool maxSizeReached() const;
-    bool maxAgeReached() const;
-    void setMaxAge(std::chrono::milliseconds max_age);
-    void setMaxSize(size_t max_size);
+    bool maxSizeReached(const std::optional<size_t> max_size) const;
+    bool maxAgeReached(const std::optional<std::chrono::milliseconds> max_age) 
const;
     void flushAndReplace(core::ProcessSession* session, const 
core::Relationship& relationship,
                          const std::shared_ptr<core::FlowFile>& 
new_buffered_flow_file);
 
     bool empty() const { return buffered_flow_file_ == nullptr; }
+    std::optional<size_t> getNextFragmentOffset() const;
 
    private:
     void store(core::ProcessSession* session, const 
std::shared_ptr<core::FlowFile>& new_buffered_flow_file);
 
     std::shared_ptr<core::FlowFile> buffered_flow_file_;
     std::chrono::steady_clock::time_point creation_time_;
-    std::optional<std::chrono::milliseconds> max_age_;
-    std::optional<size_t> max_size_;
   };
 
+  class FragmentSource {
+   public:
+    class Id {
+     public:
+      explicit Id(const core::FlowFile& flow_file);
+      struct hash {
+        size_t operator()(const Id& fragment_id) const;
+      };
+      bool operator==(const Id& rhs) const = default;
+     protected:
+      std::optional<std::string> base_name_attribute_;
+      std::optional<std::string> post_name_attribute_;
+    };
+
+    Buffer buffer_;

Review comment:
       good idea, 
https://github.com/apache/nifi-minifi-cpp/pull/1248/commits/5fa9ae6f2c1b5f2be1bbcb4a745ba51251ae300c




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to