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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]