MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / addConnection

Method addConnection

libminifi/src/core/ProcessGroup.cpp:347–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void ProcessGroup::addConnection(const std::shared_ptr<Connection>& connection) {
348 std::lock_guard<std::recursive_mutex> lock(mutex_);
349
350 if (connections_.find(connection) == connections_.end()) {
351 // We do not have the same connection in this process group yet
352 connections_.insert(connection);
353 logger_->log_debug("Add connection %s into process group %s", connection->getName(), name_);
354 std::shared_ptr<Processor> source = this->findProcessorById(connection->getSourceUUID());
355 if (source)
356 source->addConnection(connection);
357 std::shared_ptr<Processor> destination = this->findProcessorById(connection->getDestinationUUID());
358 if (destination && destination != source)
359 destination->addConnection(connection);
360 }
361}
362
363void ProcessGroup::removeConnection(const std::shared_ptr<Connection>& connection) {
364 std::lock_guard<std::recursive_mutex> lock(mutex_);

Callers

nothing calls this directly

Calls 8

findProcessorByIdMethod · 0.95
log_debugMethod · 0.80
getSourceUUIDMethod · 0.80
getDestinationUUIDMethod · 0.80
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected