MINIFICPP-2867 Implement ForkEnrichment/JoinEnrichmentAttributes - #2221
MINIFICPP-2867 Implement ForkEnrichment/JoinEnrichmentAttributes#2221martinzink wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “enrichment fork/join” mechanism to MiNiFi C++ standard processors, enabling a FlowFile to be cloned for enrichment and later rejoined with merged attributes.
Changes:
- Added new
ForkEnrichmentandJoinEnrichmentAttributesprocessors (including attribute keys shared via a small utility header). - Added unit tests and a Behave feature test validating enrichment + join behavior.
- Updated processor documentation, Behave step definitions, and the GitHub reference manifest to include the new processors.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| PROCESSORS.md | Documents the new processors, their properties, relationships, and output attributes. |
| extensions/standard-processors/utils/EnrichmentUtils.h | Introduces shared attribute-name constants for enrichment correlation/role. |
| extensions/standard-processors/processors/ForkEnrichment.h | Declares the fork processor (clones FlowFiles and sets correlation/role attributes). |
| extensions/standard-processors/processors/ForkEnrichment.cpp | Implements cloning + attribute assignment + routing logic. |
| extensions/standard-processors/processors/JoinEnrichmentAttributes.h | Declares the join processor (pairing/timeout tracking and join output). |
| extensions/standard-processors/processors/JoinEnrichmentAttributes.cpp | Implements pairing by group id, merging attributes, and timeout routing. |
| extensions/standard-processors/tests/unit/ForkEnrichmentTests.cpp | Unit coverage for basic fork behavior and max-batch handling. |
| extensions/standard-processors/tests/unit/JoinEnrichmentAttributesTests.cpp | Unit coverage for invalid inputs, pairing behavior, and timeout/max-batch. |
| extensions/standard-processors/tests/features/enrichment.feature | End-to-end Behave scenario verifying enrichment + join in a composed flow. |
| behave_framework/src/minifi_behave/steps/flow_building_steps.py | Adds “an …” variants for processor step definitions used by the new feature. |
| .github/references/ubuntu_22_04_clang_arm_manifest.json | Registers the new processors and their property/relationship metadata in the reference manifest. |
Comments suppressed due to low confidence (1)
extensions/standard-processors/processors/JoinEnrichmentAttributes.h:131
- Typo in comment: "cant" -> "can't".
// We need to track current session's FlowFiles (we cant add those)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "core/FlowFileStore.h" | ||
| #include "core/ProcessorImpl.h" | ||
| #include "core/PropertyDefinitionBuilder.h" | ||
| #include "minifi-cpp/core/PropertyDefinition.h" | ||
| #include "utils/Enum.h" | ||
| #include "utils/RegexUtils.h" |
| #include "JoinEnrichmentAttributes.h" | ||
| #include "unit/Catch.h" | ||
| #include "unit/ProcessorUtils.h" | ||
| #include "unit/SingleProcessorTestController.h" | ||
| #include "utils/EnrichmentUtils.h" |
| } | ||
|
|
||
| if (const auto pair_node = pair_map.extract(group_id)) { | ||
| logger_->log_trace("Match found"); |
There was a problem hiding this comment.
We could log the group id to see which group id the match was found for.
| }; | ||
| } // namespace join_enrichment_attributes | ||
|
|
||
| using MapType = std::unordered_map<std::string, std::shared_ptr<core::FlowFile>, utils::string::transparent_string_hash, std::equal_to<>>; |
There was a problem hiding this comment.
This could be renamed to be a bit more descriptive.
|
|
||
| core::FlowFileStore flow_file_store_; | ||
| // We need to track current session's FlowFiles (we cant add those) | ||
| std::vector<utils::Identifier> session_flow_files_; |
There was a problem hiding this comment.
Only addition and contains functionality is used for this container without need for ordering, it may be better to use unordered_set for this.
bcfed19 to
f5ec2a8
Compare
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.