arpadboda commented on a change in pull request #601: MINIFICPP-937: resolve 
state file issues and rollover issues. Add tes…
URL: https://github.com/apache/nifi-minifi-cpp/pull/601#discussion_r298570258
 
 

 ##########
 File path: extensions/standard-processors/processors/TailFile.cpp
 ##########
 @@ -250,6 +259,24 @@ bool TailFile::recoverState() {
   for (file.getline(buf, BUFFER_SIZE); file.good(); file.getline(buf, 
BUFFER_SIZE)) {
     parseStateFileLine(buf);
   }
+
+  /**
+   * recover times and validate that we have paths
+   */
+
+  for (auto &state : tail_states_) {
+    std::string fileLocation, fileName;
+    if 
(!utils::file::PathUtils::getFileNameAndPath(state.second.current_file_name_, 
fileLocation, fileName) && state.second.path_.empty()) {
+      throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION, "State file 
does not contain a full path and file name");
 
 Review comment:
   I feel a bit of inconsistency here.
   This works well, but in case the file cannot even be openned, we just print 
a log statement, in this case however an exception is thrown, which means 
giving up doing work in the given "ontrigger call". 
   
   Is it intended to be done this way? 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to