Skip to content

Conversation

@martinzink
Copy link
Member

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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

credential_configuration_strategy_string = "Workload Identity";
}

auto azure_storage_cred_service = plan_->addController("AzureStorageCredentialsService", "AzureStorageCredentialsService");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ and process_groups_ maps into a single services_ map with a ServiceEntry structure
  • Introduces an alternative_keys map and register_alternative_key() method to enable lookup by both UUID and name
  • Updates the put() method signature to accept ProcessGroup* and removes the separate put(id, ProcessGroup*) overload
  • Modifies createControllerService() and putControllerServiceNode() throughout the codebase to pass parent_group and alternative_key parameters

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant