Github user achristianson commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/148#discussion_r145731149
  
    --- Diff: libminifi/include/core/ProcessSession.h ---
    @@ -151,11 +152,47 @@ class ProcessSession {
       bool keepSource,
                   uint64_t offset, char inputDelimiter);
     
    +  /**
    +   * Exports the data stream to a file
    +   * @param string file to export stream to
    +   * @param flow flow file
    +   * @param bool whether or not to keep the content in the flow file
    +   */
    +  bool exportContent(const std::string &destination,
    --- End diff --
    
    Export is simply meant to be the inverse of import.
    
    Digging into the code, export is used in this change set in 
UnfocusArchiveEntry in order to export the flow file content into a 
scratch/working location so that it can be re-assembled back into an archive.
    
    We're ultimately calling archive_write_data (line 286 of 
UnfocusArchiveEntry.cpp), which takes data from a byte buffer. Therefore, we 
don't necessarily require a persistent filesystem for this change, as this 
scratch/working area could be in RAM or some other medium as long as there's 
enough space.
    
    As it stands, these new archive processors do depend on persistent 
filesystem storage, but this addition of exportContent does not result in 
ProcessSession or any core component depending on any storage implementation 
where it previously did not. We're simply adding an mirror capability to import 
which is optional to use, and where the caller is responsible for environmental 
considerations/requirements such as persistent storage.
    
    Assuming we move these new archive processors into an extension, a current 
prerequisite of using that extension will be persistent filesystem storage. 
This should be documented. This leaves open the door to future 
implementations/improvements which use RAM or some other medium to reconstitute 
the archive, but I think that level of functionality is not required 
immediately.


---

Reply via email to