lordgamez commented on a change in pull request #866:
URL: https://github.com/apache/nifi-minifi-cpp/pull/866#discussion_r468590741
##########
File path: extensions/libarchive/MergeContent.cpp
##########
@@ -342,6 +362,56 @@ std::shared_ptr<core::FlowFile>
ZipMerge::merge(core::ProcessContext *context, c
return flowFile;
}
+void AttributeMerger::mergeAttributes() {
+ std::map<std::string, std::string> commonAttributes = getCommonAttributes();
+
+ for (const auto& pair : commonAttributes) {
+ session_->putAttribute(mergeFlow_, pair.first, pair.second);
+ }
+}
+
+std::map<std::string, std::string> AttributeMerger::getCommonAttributes() {
+ std::map<std::string, std::string> commonAttributes;
Review comment:
Are you suggesting something like this?
`auto attr = flow->getAttributes();`
`std::map<std::string, std::string> tmpMerged;`
`std::set_intersection(std::make_move_iterator(mergedAttributes.begin()),
std::make_move_iterator(mergedAttributes.end()),
std::make_move_iterator(attr.begin()), std::make_move_iterator(attr.end()),
std::inserter(tmpMerged, tmpMerged.begin()));`
`mergedAttributes = std::move(tmpMerged);`
Wouldn't it invalidate the original attributes of the original flowfile or
it doesn't matter in this case?
----------------------------------------------------------------
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]