You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/08/16 12:39:08 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a diff in pull request #1388: MINIFICPP-1896 Change C2 component-level start/stop commands to use UUID

fgerlits commented on code in PR #1388:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1388#discussion_r946564214


##########
extensions/http-curl/tests/HTTPHandlers.h:
##########
@@ -590,7 +590,7 @@ class HeartbeatHandler : public ServerAwareHandler {
       case minifi::c2::Operation::STOP: {
         auto operands = getOperandsOfProperties(operation_node);
         assert(operands.find("c2") != operands.end());
-        assert(operands.find("FlowController") != operands.end());
+        // FlowController is also present, but this handler has no way of knowing its UUID to test it

Review Comment:
   can we assert that `operands.size() == verify_components.size() + 2` (with a comment about `FlowController`)?



##########
libminifi/src/FlowController.cpp:
##########
@@ -558,19 +552,20 @@ std::vector<state::StateController*> FlowController::getAllProcessorControllers(
   return controllerVec;
 }
 
-state::StateController* FlowController::getProcessorController(const std::string& name, const std::function<std::unique_ptr<state::ProcessorController>(core::Processor&)>& controllerFactory) {
-  auto* processor = root_->findProcessorByName(name);
-  if (processor == nullptr) {
-    logger_->log_error("Could not get processor controller for requested name \"%s\", because processor was not found either", name);
-    return nullptr;
-  }
-
-  // reference to the existing or newly created controller
-  auto& foundController = processor_to_controller_[processor->getUUID()];
-  if (!foundController) {
-    foundController = controllerFactory(*processor);
-  }
-  return foundController.get();
+state::StateController* FlowController::getProcessorController(const std::string& id_or_name, const std::function<std::unique_ptr<state::ProcessorController>(core::Processor&)>& controllerFactory) {

Review Comment:
   you added a `gsl::not_null` to the return type of the `controllerFactory` functor at other places, but not here; why?



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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org