[ 
https://issues.apache.org/jira/browse/MINIFICPP-39?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16218551#comment-16218551
 ] 

ASF GitHub Bot commented on MINIFICPP-39:
-----------------------------------------

Github user phrocker commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/148
  
    diff --git a/libminifi/src/processors/FocusArchiveEntry.cpp 
b/libminifi/src/processors/FocusArchiveEntry.cpp
    index c262217..42962a6 100644
    --- a/libminifi/src/processors/FocusArchiveEntry.cpp
    +++ b/libminifi/src/processors/FocusArchiveEntry.cpp
    @@ -24,8 +24,6 @@
     
     #include <string.h>
     
    -#include <boost/filesystem.hpp>
    -
     #include <string>
     #include <set>
     
    @@ -154,11 +152,11 @@ void 
FocusArchiveEntry::onTrigger(core::ProcessContext *context,
           entryVal["entry_name"] = Json::Value(entryMetadata.entryName);
           entryVal["entry_type"] = Json::Value(entryMetadata.entryType);
           entryVal["entry_perm"] = Json::Value(entryMetadata.entryPerm);
    -      entryVal["entry_size"] = Json::Value(entryMetadata.entrySize);
    +      entryVal["entry_size"] = 
Json::Value((uint64_t)entryMetadata.entrySize);
           entryVal["entry_uid"] = Json::Value(entryMetadata.entryUID);
           entryVal["entry_gid"] = Json::Value(entryMetadata.entryGID);
    -      entryVal["entry_mtime"] = Json::Value(entryMetadata.entryMTime);
    -      entryVal["entry_mtime_nsec"] = 
Json::Value(entryMetadata.entryMTimeNsec);
    +      entryVal["entry_mtime"] = 
Json::Value((uint64_t)entryMetadata.entryMTime);
    +      entryVal["entry_mtime_nsec"] = 
Json::Value((int64_t)entryMetadata.entryMTimeNsec);
     
           if (entryMetadata.entryType == AE_IFREG) {
               entryVal["stash_key"] = Json::Value(entryMetadata.stashKey);
    @@ -221,7 +219,7 @@ int64_t 
FocusArchiveEntry::ReadCallback::process(std::shared_ptr<io::BaseStream>
       archive_read_support_filter_all(inputArchive);
     
       // Read callback which reads from ifstream
    -  auto read = [] (archive * a, void *d, const void **buf) -> int64_t {
    +  auto read = [] (struct archive * a, void *d, const void **buf) -> long {
         auto data = static_cast<FocusArchiveEntryReadData *>(d);
         *buf = data->buf;
         int64_t read = 0;
    @@ -241,7 +239,7 @@ int64_t 
FocusArchiveEntry::ReadCallback::process(std::shared_ptr<io::BaseStream>
       };
     
       // Close callback for libarchive
    -  auto close = [] (archive *, void *) -> int {
    +  auto close = [] (struct archive *, void *) -> int {
         // Because we do not need to close the stream, do nothing & return 
success
         return 0;
       };
    @@ -249,7 +247,7 @@ int64_t 
FocusArchiveEntry::ReadCallback::process(std::shared_ptr<io::BaseStream>
       // Read each item in the archive
       int res;
     
    -  if ((res = archive_read_open(inputArchive, &data, NULL, read, close))) {
    +  if ((res = archive_read_open(inputArchive, &data, nullptr, read, 
close))) {
           logger_->log_error(
               "FocusArchiveEntry can't open due to archive error: %s",
               archive_error_string(inputArchive));


> Create FocusArchive processor
> -----------------------------
>
>                 Key: MINIFICPP-39
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-39
>             Project: NiFi MiNiFi C++
>          Issue Type: Task
>            Reporter: Andrew Christianson
>            Assignee: Andrew Christianson
>            Priority: Minor
>
> Create an FocusArchive processor which implements a lens over an archive 
> (tar, etc.). A concise, though informal, definition of a lens is as follows:
> "Essentially, they represent the act of “peering into” or “focusing in on” 
> some particular piece/path of a complex data object such that you can more 
> precisely target particular operations without losing the context or 
> structure of the overall data you’re working with." 
> https://medium.com/@dtipson/functional-lenses-d1aba9e52254#.hdgsvbraq
> Why an FocusArchive in MiNiFi? Simply put, it will enable us to "focus in on" 
> an entry in the archive, perform processing *in-context* of that entry, then 
> re-focus on the overall archive. This allows for transformation or other 
> processing of an entry in the archive without losing the overall context of 
> the archive.
> Initial format support is tar, due to its simplicity and ubiquity.
> Attributes:
> - Path (the path in the archive to focus; "/" to re-focus the overall archive)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to