lordgamez commented on a change in pull request #866:
URL: https://github.com/apache/nifi-minifi-cpp/pull/866#discussion_r468403366



##########
File path: extensions/libarchive/MergeContent.cpp
##########
@@ -271,6 +281,16 @@ bool MergeContent::processBin(core::ProcessContext 
*context, core::ProcessSessio
       return false;
     }
     session->putAttribute(mergeFlow, BinFiles::FRAGMENT_COUNT_ATTRIBUTE, 
std::to_string(bin->getSize()));
+
+    std::unique_ptr<AttributeMerger> attributeMerger;
+    if (attributeStrategy_ == ATTRIBUTE_STRATEGY_KEEP_COMMON)
+      attributeMerger = std::unique_ptr < AttributeMerger > (new 
KeepOnlyCommonAttributesMerger(session, bin->getFlowFile(), mergeFlow));
+    else if (attributeStrategy_ == ATTRIBUTE_STRATEGY_KEEP_ALL_UNIQUE)
+      attributeMerger = std::unique_ptr < AttributeMerger > (new 
KeepAllUniqueAttributesMerger(session, bin->getFlowFile(), mergeFlow));
+    else
+      return false;

Review comment:
       I think throwing would be a better way in this scenario as this should 
be unreachable because of the allowed values, so it would suggest a bigger 
problem. Same for the merge strategy, although there is an actual unreachable 
code there as `mergeFormat_` is checked both on line 258 and 260 so we could 
never reach the `return false` statement on line 267.




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


Reply via email to