nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi-minifi-cpp] phrocker commented on a change in pull request #596: MINIFICPP-925 - Fix TailFile hang on long lines
Date Mon, 24 Jun 2019 17:20:52 GMT
phrocker commented on a change in pull request #596: MINIFICPP-925 - Fix TailFile hang on long
lines
URL: https://github.com/apache/nifi-minifi-cpp/pull/596#discussion_r296828970
 
 

 ##########
 File path: libminifi/src/core/ProcessSession.cpp
 ##########
 @@ -537,63 +534,82 @@ void ProcessSession::import(std::string source, const std::shared_ptr<core::Flow
   }
 }
 
-void ProcessSession::import(std::string source, std::vector<std::shared_ptr<FlowFileRecord>>
&flows, bool keepSource, uint64_t offset, char inputDelimiter) {
+void ProcessSession::import(const std::string& source, std::vector<std::shared_ptr<FlowFileRecord>>
&flows, uint64_t offset, char inputDelimiter) {
   std::shared_ptr<ResourceClaim> claim;
+  std::shared_ptr<io::BaseStream> stream;
   std::shared_ptr<FlowFileRecord> flowFile;
-  int size = getpagesize();
-  std::vector<char> charBuffer;
-  charBuffer.resize(size);
 
+  std::vector<uint8_t> buffer(getpagesize());
   try {
-    // Open the input file and seek to the appropriate location.
-    std::ifstream input;
-    logger_->log_debug("Opening %s", source);
-    input.open(source.c_str(), std::fstream::in | std::fstream::binary);
-    if (input.is_open() && input.good()) {
-      if (offset != 0) {
+    try {
+      std::ifstream input;
 
 Review comment:
   is this a change in the spacing? Did you apply the linter? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message