lordgamez commented on a change in pull request #893:
URL: https://github.com/apache/nifi-minifi-cpp/pull/893#discussion_r484927149



##########
File path: libminifi/src/FlowController.cpp
##########
@@ -216,9 +215,6 @@ bool FlowController::applyConfiguration(const std::string 
&source, const std::st
   bool started = false;
   try {
     load(this->root_, true);
-    flow_update_ = true;
-    started = start() == 0;

Review comment:
       Was this supposed to be removed? The code in the conditional branch `if 
(started) {` below now seems to be dead code.

##########
File path: libminifi/src/FlowController.cpp
##########
@@ -441,43 +429,40 @@ void FlowController::initializeC2() {
      * The ticket that impacts this, MINIFICPP-664, should be reversed in the 
event that agent registration
      * can be performed and agent classes needn't be defined a priori.
      */
-    c2_enabled_ = false;
+    enable_c2 = false;
   }
 
-  if (!c2_enabled_) {
-    return;
-  }
+  return std::make_tuple(class_str, enable_c2);
+}
 
-  std::string identifier_str;
-  if (!configuration_->get("nifi.c2.agent.identifier", "c2.agent.identifier", 
identifier_str) || identifier_str.empty()) {
+std::string FlowController::getReloadedC2AgentIdentifier() {
+  std::string agent_identifier;
+  if (!configuration_->get("nifi.c2.agent.identifier", "c2.agent.identifier", 
agent_identifier) || agent_identifier.empty()) {
     // set to the flow controller's identifier
-    identifier_str = uuidStr_;
+    agent_identifier = uuidStr_;
   }
-  configuration_->setAgentIdentifier(identifier_str);
+  return agent_identifier;
+}
 
-  if (c2_initialized_ && !flow_update_) {
-    return;
+void FlowController::addQueueMetricsToDeviceInformation() {
+  std::shared_ptr<state::response::QueueMetrics> queueMetrics = 
std::make_shared<state::response::QueueMetrics>();
+  std::map<std::string, std::shared_ptr<Connection>> connections;
+  root_->getConnections(connections);
+  for (auto con : connections) {

Review comment:
       This could be `const auto&`




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to