szaszm commented on code in PR #1616:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1616#discussion_r1301159614


##########
extensions/libarchive/BinFiles.cpp:
##########
@@ -203,93 +208,97 @@ bool BinManager::offer(const std::string &group, const 
std::shared_ptr<core::Flo
   return true;
 }
 
-void BinFiles::onTrigger(const std::shared_ptr<core::ProcessContext> &context, 
const std::shared_ptr<core::ProcessSession> &session) {
-  // Rollback is not viable for this processor!!
-  {
-    // process resurrected FlowFiles first
-    auto flowFiles = file_store_.getNewFlowFiles();
-    // these are already processed FlowFiles, that we own
-    bool hadFailure = false;
-    for (auto &file : flowFiles) {
-      std::string groupId = getGroupId(context.get(), file);
-      bool offer = this->binManager_.offer(groupId, file);
-      if (!offer) {
-        session->transfer(file, Failure);
-        hadFailure = true;
-      } else {
-        // no need to route successfully captured such files as we already own 
them
-      }
-    }
-    if (hadFailure) {
-      context->yield();
-      return;
+bool BinFiles::resurrectFlowFiles(core::ProcessSession &session) {
+  auto flow_files = file_store_.getNewFlowFiles();
+  // these are already processed FlowFiles, that we own
+  bool had_failure = false;
+  for (auto &file : flow_files) {
+    std::string group_id = getGroupId(file);
+    if (!binManager_.offer(group_id, file)) {
+      session.transfer(file, Failure);
+      had_failure = true;
     }
+    // no need to route successfully captured such files as we already own 
them in the Self relationship
   }
+  return had_failure;
+}
 
+void BinFiles::assumeOwnerShipOfNextBatch(core::ProcessSession &session) {

Review Comment:
   A bit of a nitpick, but ownership is one word, so the "s" shouldn't be 
capital in camelCase.



-- 
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