adamdebreceni commented on a change in pull request #822:
URL: https://github.com/apache/nifi-minifi-cpp/pull/822#discussion_r450927873
##########
File path: libminifi/src/core/Processor.cpp
##########
@@ -289,6 +303,109 @@ bool Processor::isWorkAvailable() {
return hasWork;
}
+// must hold the graphMutex
+void Processor::updateReachability(const std::lock_guard<std::mutex>&
graph_lock, bool force) {
+ bool didChange = force;
+ for (auto& outIt : out_going_connections_) {
+ for (auto& outConn : outIt.second) {
+ auto connection = std::dynamic_pointer_cast<Connection>(outConn);
+ if (!connection) {
+ continue;
+ }
+ auto dest = std::dynamic_pointer_cast<const
Processor>(connection->getDestination());
+ if (!dest) {
+ continue;
+ }
+ if (reachable_processors_[connection].insert(dest).second) {
+ didChange = true;
+ }
+ for (auto& reachedIt : dest->reachable_processors_) {
+ for (auto &reached_proc : reachedIt.second) {
Review comment:
I'm all for a O(better) solution 🙂 but yeah it probably won't be the
bottleneck
----------------------------------------------------------------
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]