adamdebreceni commented on code in PR #1360:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1360#discussion_r945697728
##########
libminifi/src/core/state/nodes/ResponseNodeLoader.cpp:
##########
@@ -59,17 +59,17 @@ void
ResponseNodeLoader::initializeComponentMetrics(core::ProcessGroup* root) {
node_source->getResponseNodes(metric_vector);
std::lock_guard<std::mutex> guard(component_metrics_mutex_);
for (const auto& metric : metric_vector) {
- component_metrics_[metric->getName()] = metric;
+ component_metrics_[metric->getName()].push_back(metric);
}
}
}
-std::shared_ptr<ResponseNode> ResponseNodeLoader::getResponseNode(const
std::string& clazz) const {
+std::vector<std::shared_ptr<ResponseNode>>
ResponseNodeLoader::getResponseNodes(const std::string& clazz) const {
std::shared_ptr<core::CoreComponent> ptr =
core::ClassLoader::getDefaultClassLoader().instantiate(clazz, clazz);
if (ptr == nullptr) {
- return getComponentMetricsNode(clazz);
+ return getComponentMetricsNodes(clazz);
}
- return std::dynamic_pointer_cast<ResponseNode>(ptr);
+ return {std::dynamic_pointer_cast<ResponseNode>(ptr)};
Review Comment:
is "having only non-null elements" an invariant of the return value of
`getResponseNodes`, or do we check everywhere we use it for nulls?
--
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]