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 2020/09/03 09:45:06 UTC

[GitHub] [nifi-minifi-cpp] hunyadi-dev opened a new pull request #893: MINIFICPP-1288 - FlowController C2 init refactor

hunyadi-dev opened a new pull request #893:
URL: https://github.com/apache/nifi-minifi-cpp/pull/893


   Split up FlowController::initializeC2, remove atomicity from c2_initialized_, delete flow_update_ field.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #893: MINIFICPP-1288 - FlowController C2 init refactor

Posted by GitBox <gi...@apache.org>.
hunyadi-dev commented on a change in pull request #893:
URL: https://github.com/apache/nifi-minifi-cpp/pull/893#discussion_r544141796



##########
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:
       Honestly, I don't remember what was exactly extracted into this PR. I think this was opened to ease the review load on #890, but the boundaries are probably not correctly set. Closing this PR.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] hunyadi-dev closed pull request #893: MINIFICPP-1288 - FlowController C2 init refactor

Posted by GitBox <gi...@apache.org>.
hunyadi-dev closed pull request #893:
URL: https://github.com/apache/nifi-minifi-cpp/pull/893


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on pull request #893: MINIFICPP-1288 - FlowController C2 init refactor

Posted by GitBox <gi...@apache.org>.
hunyadi-dev commented on pull request #893:
URL: https://github.com/apache/nifi-minifi-cpp/pull/893#issuecomment-745982304


   Probably part of #890, not worth rebasing separately.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #893: MINIFICPP-1288 - FlowController C2 init refactor

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org