msharee9 commented on a change in pull request #743: Minificpp 1169 - Simplify 
C2 metrics collection and reporting
URL: https://github.com/apache/nifi-minifi-cpp/pull/743#discussion_r390614132
 
 

 ##########
 File path: libminifi/include/FlowController.h
 ##########
 @@ -304,23 +305,23 @@ class FlowController : public 
core::controller::ControllerServiceProvider, publi
   virtual void enableAllControllerServices();
 
   /**
-   * Retrieves all root response nodes from this source.
-   * @param metric_vector -- metrics will be placed in this vector.
-   * @return result of the get operation.
-   *  0 Success
-   *  1 No error condition, but cannot obtain lock in timely manner.
-   *  -1 failure
+   * Retrieves metrics node
+   * @return metrics response node
    */
-  virtual int16_t 
getResponseNodes(std::vector<std::shared_ptr<state::response::ResponseNode>> 
&metric_vector, uint16_t metricsClass);
+  virtual std::shared_ptr<state::response::ResponseNode> getMetricsNode() 
const;
+
+  /**
+   * Retrieves root nodes configured to be included in heartbeat
+   * @param includeManifest -- determines if manifest is to be included
+   * @return a list of response nodes
+   */
+  virtual std::vector<std::shared_ptr<state::response::ResponseNode>> 
getHeartbeatNodes(bool includeManifest) const;
 
 Review comment:
   We can definitely have raw pointers in root_response_nodes_ but is there a 
reason not to use shared pointers?
   I understand we cannot use unique_ptrs here as we want to have the 
FlowController maintain ownership of the nodes and share it with C2Agent. But, 
given the choices of smart pointers we have shared_ptr is the best one we can 
use in this case. Having said that, I am not a strong adherent of using 
shared_ptr universally. In this case I think it is more of a coding 
guidelines/style/consistency in the code base.
   
   

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


With regards,
Apache Git Services

Reply via email to