MINIFICPP-2710 Refactor ControllerServiceNodeMap#2098
MINIFICPP-2710 Refactor ControllerServiceNodeMap#2098martinzink wants to merge 13 commits intoapache:MINIFICPP-2669from
Conversation
| credential_configuration_strategy_string = "Workload Identity"; | ||
| } | ||
|
|
||
| auto azure_storage_cred_service = plan_->addController("AzureStorageCredentialsService", "AzureStorageCredentialsService"); |
There was a problem hiding this comment.
The main change in this file was I removed these duplicate ControllerServices from the stack and used the azure_storage_cred_service_ already defined in the test fixture
There was a problem hiding this comment.
Pull request overview
This PR refactors the ControllerServiceNodeMap class to consolidate its internal data structure and streamline the API for managing controller service nodes. The refactoring eliminates the need for separate calls to register controller service nodes and their associated process groups by combining this information into a single ServiceEntry structure. It also introduces an alternative key mechanism to allow controller services to be looked up by either UUID or name without duplicating the service node entries.
Changes:
- Consolidates the separate
controller_service_nodes_andprocess_groups_maps into a singleservices_map with aServiceEntrystructure - Introduces an
alternative_keysmap andregister_alternative_key()method to enable lookup by both UUID and name - Updates the
put()method signature to acceptProcessGroup*and removes the separateput(id, ProcessGroup*)overload - Modifies
createControllerService()andputControllerServiceNode()throughout the codebase to passparent_groupandalternative_keyparameters
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libminifi/include/core/controller/ControllerServiceNodeMap.h | Refactored data structure to use ServiceEntry and alternative_keys map; added register_alternative_key method |
| libminifi/src/core/controller/ControllerServiceNodeMap.cpp | Implemented consolidated put() method, alternative key registration, and updated get/clear methods |
| libminifi/include/core/controller/ControllerServiceProvider.h | Updated virtual method signatures to accept parent group and alternative key parameters |
| libminifi/include/core/controller/StandardControllerServiceProvider.h | Updated createControllerService signature |
| libminifi/src/core/controller/StandardControllerServiceProvider.cpp | Implemented alternative key registration in createControllerService |
| libminifi/include/core/controller/ForwardingControllerServiceProvider.h | Updated forwarding method signatures |
| libminifi/src/core/controller/ControllerServiceProvider.cpp | Updated putControllerServiceNode implementation to use new API |
| libminifi/src/core/FlowConfiguration.cpp | Updated createControllerService call to pass parent group and UUID as alternative key |
| libminifi/src/core/flow/StructuredConfiguration.cpp | Updated to pass parent_group to createControllerService and removed manual putControllerServiceNode calls |
| libminifi/src/core/ProcessGroup.cpp | Updated addControllerService to pass this pointer to put() |
| libminifi/include/core/ProcessContextImpl.h | Updated createControllerService call to pass nullptr and std::nullopt |
| libminifi/test/libtest/unit/TestBase.cpp | Updated addController to use new API and removed manual putControllerServiceNode calls |
| libminifi/test/unit/ProcessorConfigUtilsTests.cpp | Updated test mock to match new createControllerService signature |
| extensions/standard-processors/tests/unit/ControllerServiceTests.cpp | Updated test calls to put() method to include parent_group parameter |
| extensions/azure/tests/ListAzureBlobStorageTests.cpp | Wrapped setProperty calls with CHECK() for better test validation (unrelated improvement) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0e54f0b to
d6bf004
Compare
4736c83 to
4275485
Compare
4275485 to
4a59b25
Compare
Closes #2098 Signed-off-by: Martin Zink <martinzink@apache.org>
4b247a1 to
0972302
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.